Protobuf MongoDB async client

Provide a Protobuf BSON Codec Provider for MongoDB, written by Kotlin

License

License

GroupId

GroupId

io.github.gaplotech
ArtifactId

ArtifactId

pbmongo-async
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

Protobuf MongoDB async client
Provide a Protobuf BSON Codec Provider for MongoDB, written by Kotlin
Project URL

Project URL

https://github.com/gaplotech/kotlin-protobuf-bson-codec
Source Code Management

Source Code Management

https://github.com/gaplotech/kotlin-protobuf-bson-codec

Download pbmongo-async

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.gaplotech/pbmongo-async/ -->
<dependency>
    <groupId>io.github.gaplotech</groupId>
    <artifactId>pbmongo-async</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.gaplotech/pbmongo-async/
implementation 'io.github.gaplotech:pbmongo-async:0.2.0'
// https://jarcasting.com/artifacts/io.github.gaplotech/pbmongo-async/
implementation ("io.github.gaplotech:pbmongo-async:0.2.0")
'io.github.gaplotech:pbmongo-async:jar:0.2.0'
<dependency org="io.github.gaplotech" name="pbmongo-async" rev="0.2.0">
  <artifact name="pbmongo-async" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.gaplotech', module='pbmongo-async', version='0.2.0')
)
libraryDependencies += "io.github.gaplotech" % "pbmongo-async" % "0.2.0"
[io.github.gaplotech/pbmongo-async "0.2.0"]

Dependencies

compile (5)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.2.41
io.github.gaplotech : kotlin-protobuf-bson-codec jar 0.2.0
org.mongodb : mongodb-driver-async jar 3.7.0
com.google.protobuf : protobuf-java jar 3.5.1
com.google.protobuf : protobuf-java-util jar 3.5.1

test (4)

Group / Artifact Type Version
junit : junit jar 4.12
org.litote.kmongo : kmongo-coroutine jar 3.6.2
io.kotlintest : kotlintest-runner-junit5 jar 3.0.4
org.jetbrains.kotlinx : kotlinx-coroutines-core jar 0.22.3

Project Modules

There are no modules declared in this project.

Introduction

kotlin-protobuf-bson-codec provide a PBCodecProvider to encode/decode from google protocol buffer & BSON genericly. It is 100% written by Kotlin.

The underlying implementation (PBBsonReader & PBBsonWriter) are mainly inspired by the official google protocol buffer json serialization (JsonFormat.Parser & JsonFormat.Printer).

Compatibility

PBCodecProvider is compatible to all mongodb driver using org.bson.*, for example

Note: Only Proto3 is supported

Gradle

compile 'io.github.gaplotech:kotlin-protobuf-bson-codec:0.3.0'

Maven

<dependency>
  <groupId>io.github.gaplotech</groupId>
  <artifactId>kotlin-protobuf-bson-codec</artifactId>
  <version>0.3.0</version>
</dependency>

Example

// register the codec provider
val registry = CodecRegistries.fromRegistries(
                   CodecRegistries.fromProviders(PBCodecProvider()),
                   MongoClients.getDefaultCodecRegistry()
               )

// use the registry for the database
val collection = createClient()
    .getDatabase(...)
    .withCodecRegistry(registry)
io.github.gaplotech

GapLoTech

Versions

Version
0.2.0