datasource

package
v1.5.31 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplaceObjectIds added in v1.2.12

func ReplaceObjectIds(data interface{}) interface{}

Types

type Datasource

type Datasource struct {
	Name    string
	Db      interface{}
	Viper   *viper.Viper
	Key     string
	Context context.Context
	Options *Options
	// contains filtered or unexported fields
}

func New

func New(dsKey string, dsViper *viper.Viper, parentContext context.Context) *Datasource

func (*Datasource) Create

func (ds *Datasource) Create(collectionName string, data *wst.M) (*wst.M, error)

func (*Datasource) DeleteById

func (ds *Datasource) DeleteById(collectionName string, id interface{}) int64

func (*Datasource) FindMany

func (ds *Datasource) FindMany(collectionName string, lookups *wst.A) (*wst.A, error)

func (*Datasource) Initialize

func (ds *Datasource) Initialize() error

func (*Datasource) UpdateById

func (ds *Datasource) UpdateById(collectionName string, id interface{}, data *wst.M) (*wst.M, error)

type MonoDBDatasourceOptions added in v1.3.3

type MonoDBDatasourceOptions struct {
	Registry *bsoncodec.Registry
	Monitor  *event.CommandMonitor
}

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

type Options added in v1.3.3

type Options struct {
	MongoDB *MonoDBDatasourceOptions
}

Jump to

Keyboard shortcuts

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