mongo

package
v0.0.0-...-8baf154 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(config *config.Configuration) *mongo.Client

NewClient creates new client for mongodb

Types

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp embedding time.Time with BSON support

func (Timestamp) MarshalBSONValue

func (t Timestamp) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue implements the bsoncodec.ValueMarshaler interface.

func (*Timestamp) UnmarshalBSONValue

func (t *Timestamp) UnmarshalBSONValue(bt bsontype.Type, raw []byte) error

UnmarshalBSONValue implements the bsoncodec.ValueUnmarshaler interface.

type UUID

type UUID struct {
	uuid.UUID
}

UUID embedding uuid.UUID and adds bson support

func NewUUID

func NewUUID() UUID

NewUUID creates new random UUID

func (UUID) MarshalBSONValue

func (u UUID) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue implements mongo Marshaler interface

func (*UUID) UnmarshalBSONValue

func (u *UUID) UnmarshalBSONValue(t bsontype.Type, raw []byte) error

UnmarshalBSONValue implements mongo UnMarshaler interface

Jump to

Keyboard shortcuts

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