endec

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

README

FilMeta endec

Lint Code Base

FilMeta type encoder/decoder for mongodb driver.

Install

go get -u github.com/bitrainforest/filmeta-endec

Usage

package main

import (
    endec "github.com/bitrainforest/filmeta-endec"
    "go.mongodb.org/mongo-driver/mongo"
    "go.mongodb.org/mongo-driver/mongo/options"
)

func main() {
    url := "mongodb://localhost:27017"
    opt := options.Client().ApplyURI(url)
 
    // Build and SetRegistry 
    rb := endec.BuildDefaultRegistry() 
    opt.SetRegistry(rb)
    
    client, err := mongo.NewClient(opt)
    
    if err != nil {
        panic(err)
    }
    defer client.Disconnect(nil) // Disconnect after use
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDefaultRegistry

func BuildDefaultRegistry() *bsoncodec.Registry

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL