datasource

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datasource

type Datasource struct {
	Config map[string]interface{}
	Db     interface{}
}

func New

func New(config map[string]interface{}) *Datasource

func (*Datasource) Create

func (ds *Datasource) Create(collectionName string, data *bson.M) *mongo.Cursor

func (*Datasource) DeleteById

func (ds *Datasource) DeleteById(collectionName string, id primitive.ObjectID) int64

func (*Datasource) FindById

func (ds *Datasource) FindById(collectionName string, id string, filter *map[string]interface{}) *mongo.Cursor

func (*Datasource) FindMany

func (ds *Datasource) FindMany(collectionName string, filter *map[string]interface{}) *mongo.Cursor

func (*Datasource) Initialize

func (ds *Datasource) Initialize() error

func (*Datasource) UpdateById

func (ds *Datasource) UpdateById(collectionName string, id primitive.ObjectID, data *bson.M) *mongo.Cursor

type OperationError

type OperationError struct {
	Code    int
	Message string
}

func NewError

func NewError(code int, message string) *OperationError

func (*OperationError) Error

func (e *OperationError) Error() string

Jump to

Keyboard shortcuts

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