mongo

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomRegistry

func CustomRegistry() *bsoncodec.Registry

func RegisterResourceType

func RegisterResourceType(ref any, caster CastHandler)

RegisterResourceType Registers a Result ID to be encoded and decoded as a Mongo ObjectId. ref is an instance of RefType which is a Type override of a string such as: type MyReference string caster is a function which can convert a string to the type specified by the ref object (i.e. convert the string to the ref type: Example

type MyReference string mongoms.RegisterResourceType(MyReference(""),

func(id string) any {
    return MyReference(id)
 })

Types

type CastHandler

type CastHandler func(id string) any

Jump to

Keyboard shortcuts

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