Documentation ¶
Index ¶
- func InitMongoDB(ctx context.Context, conf config.Getter) error
- type CachedCollection
- func (c *CachedCollection) BulkCreate(ctx context.Context, docs []Document) error
- func (c *CachedCollection) BulkGet(ctx context.Context, out []interface{}) error
- func (c *CachedCollection) Create(ctx context.Context, doc Document) error
- func (c *CachedCollection) Delete(ctx context.Context, doc Document) error
- func (c *CachedCollection) Find(ctx context.Context, opt *QueryOpt, out interface{}) error
- func (c *CachedCollection) Get(ctx context.Context, out Document) error
- func (c *CachedCollection) GetMongoSession() (mongo.Session, error)
- func (c *CachedCollection) Increment(ctx context.Context, doc Document, fieldName string, value int) error
- func (c *CachedCollection) Replace(ctx context.Context, doc Document) error
- func (c *CachedCollection) Update(ctx context.Context, doc Document) error
- func (c *CachedCollection) UpdateField(ctx context.Context, doc Document, fieldName string, value interface{}) error
- type Document
- type FilterOpt
- type QueryOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CachedCollection ¶
type CachedCollection struct { CollectionURL string `json:"collection_url,omitempty" mapstructure:"collection_url"` CacheURL string `json:"cache_url,omitempty" mapstructure:"cache_url"` CacheExpiration int `json:"cache_expiration,omitempty" mapstructure:"cache_expiration"` EnableTransaction bool `json:"enable_transaction,omitempty" mapstructure:"enable_transaction"` Driver string Collection *docstore.Collection Cache simplecache.Cache }
func (*CachedCollection) BulkCreate ¶
func (c *CachedCollection) BulkCreate(ctx context.Context, docs []Document) error
func (*CachedCollection) BulkGet ¶
func (c *CachedCollection) BulkGet(ctx context.Context, out []interface{}) error
func (*CachedCollection) Create ¶
func (c *CachedCollection) Create(ctx context.Context, doc Document) error
func (*CachedCollection) Delete ¶
func (c *CachedCollection) Delete(ctx context.Context, doc Document) error
func (*CachedCollection) Find ¶
func (c *CachedCollection) Find(ctx context.Context, opt *QueryOpt, out interface{}) error
func (*CachedCollection) Get ¶
func (c *CachedCollection) Get(ctx context.Context, out Document) error
func (*CachedCollection) GetMongoSession ¶
func (c *CachedCollection) GetMongoSession() (mongo.Session, error)
GetMongoSession get mongo session
func (*CachedCollection) Replace ¶
func (c *CachedCollection) Replace(ctx context.Context, doc Document) error
func (*CachedCollection) Update ¶
func (c *CachedCollection) Update(ctx context.Context, doc Document) error
func (*CachedCollection) UpdateField ¶
Click to show internal directories.
Click to hide internal directories.