mongodb

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoFactory

type MongoFactory struct{}

func (*MongoFactory) Build

func (f *MongoFactory) Build(config *config.DBConfig) (iface.IDatabase, error)

build mongodb

type Mongodb

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

func Connect

func Connect(url string) (*Mongodb, error)

Return db connection

func (*Mongodb) Create

func (db *Mongodb) Create(ctx context.Context, database, table string, entity interface{}) error

func (*Mongodb) Delete

func (db *Mongodb) Delete(ctx context.Context, entityId string) error

func (*Mongodb) GetAll

func (db *Mongodb) GetAll(ctx context.Context, database, table string, entities interface{}) error

func (*Mongodb) GetByID

func (db *Mongodb) GetByID(ctx context.Context, database, table string, entityId string, entity interface{}) error

func (*Mongodb) Update

func (db *Mongodb) Update(ctx context.Context, enitty string) error

Jump to

Keyboard shortcuts

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