cmongo

package
v0.0.0-...-4092974 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRepository

func NewRepository(mongo *CMongo, collection string) *repository

Types

type CMongo

type CMongo struct {
	// contains filtered or unexported fields
}

func Init

func Init(dsn string, logger i.Logger) *CMongo

func (*CMongo) Client

func (c *CMongo) Client() *mongo.Client

func (*CMongo) Collection

func (c *CMongo) Collection(name string, opts ...*options.CollectionOptions) *mongo.Collection

func (*CMongo) Db

func (c *CMongo) Db() *mongo.Database

func (*CMongo) Ping

func (c *CMongo) Ping(ctx context.Context) error

type JsonError

type JsonError json.RawMessage

func NewJsonError

func NewJsonError(code int, message string) JsonError

func (JsonError) Error

func (j JsonError) Error() string

Jump to

Keyboard shortcuts

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