mongo

package
v1.0.1002 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type ModelEnc

type ModelEnc struct {
	Encrypted bool
	Hash      bool
	Name      string
}

type Mongo

type Mongo struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Mongo) Client

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

func (*Mongo) GetConfig

func (*Mongo) Monitor

func (c *Mongo) Monitor() *event.CommandMonitor

func (*Mongo) ODM

func (*Mongo) OnInitError

func (c *Mongo) OnInitError(e error) (client *mongo.Client, err error)

func (*Mongo) Start

func (c *Mongo) Start() (err error)

func (*Mongo) UseEncryption

func (*Mongo) WithMonitor

func (c *Mongo) WithMonitor(enable bool) databaseInterfaces.Mongo

type ODM

type ODM struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*ODM) Collection

func (c *ODM) Collection(model interface{}, name string) databaseInterfaces.MongoODM

func (*ODM) Count added in v1.0.1001

func (c *ODM) Count(ctx context.Context) (res int64, err error)

func (*ODM) Create

func (c *ODM) Create(ctx context.Context, data interface{}) (cc *databaseInterfaces.MongoTransaction)

func (*ODM) Delete

func (*ODM) Drop

func (*ODM) Error

func (c *ODM) Error() error

func (*ODM) Filter

func (c *ODM) Filter(filter map[string]interface{}) databaseInterfaces.MongoODM

func (*ODM) Find

func (c *ODM) Find(ctx context.Context, dest interface{}) (cc *databaseInterfaces.MongoTransaction)

func (*ODM) FindRaw

func (c *ODM) FindRaw(ctx context.Context) (results []bson.Raw, cc *databaseInterfaces.MongoTransaction)

func (*ODM) Index

func (c *ODM) Index() databaseInterfaces.MongoODM

func (*ODM) NativeCollection

func (c *ODM) NativeCollection() *mongo.Collection

func (*ODM) SetLimit added in v1.0.1001

func (c *ODM) SetLimit(limit int64) databaseInterfaces.MongoODM

func (*ODM) SetSkip added in v1.0.1001

func (c *ODM) SetSkip(skip int64) databaseInterfaces.MongoODM

func (*ODM) SetSort added in v1.0.1001

func (c *ODM) SetSort(sortBy string, desc bool) databaseInterfaces.MongoODM

func (*ODM) Update

func (c *ODM) Update(ctx context.Context, data map[string]interface{}) *databaseInterfaces.MongoTransaction

func (*ODM) Upsert

func (c *ODM) Upsert(ctx context.Context, data interface{}, matchKey []string) (cc *databaseInterfaces.MongoTransaction)

type Stores

type Stores struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStore

func NewStore() *Stores

func (*Stores) LoadClient

func (c *Stores) LoadClient(id string) (client *Mongo, ok bool)

func (*Stores) LoadClientByTag

func (c *Stores) LoadClientByTag(ta string) (client *Mongo, ok bool)

func (*Stores) StoreClient

func (c *Stores) StoreClient(client *Mongo)

Jump to

Keyboard shortcuts

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