Documentation ¶
Index ¶
- type Config
- type OnClearFn
- type Store
- func (s *Store) AddCloseFunc(f func())
- func (s *Store) Clear(ctx context.Context) error
- func (s *Store) Client() *mongo.Client
- func (s *Store) Close(ctx context.Context) error
- func (s *Store) Collection(collection string) *mongo.Collection
- func (s *Store) DBName() string
- func (s *Store) DropCollection(ctx context.Context, collection string) error
- func (s *Store) DropDatabase(ctx context.Context) error
- func (s *Store) EnsureIndex(ctx context.Context, collection string, indexes ...bson.D) error
- func (s *Store) SetOnClear(onClear OnClearFn)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements an Store for MongoDB.
func NewStore ¶
func NewStore(ctx context.Context, cfg *Config, tls *tls.Config, tracerProvider trace.TracerProvider) (*Store, error)
NewStore creates a new Store.
func NewStoreWithCollection ¶
func (*Store) AddCloseFunc ¶ added in v2.16.0
func (s *Store) AddCloseFunc(f func())
func (*Store) Collection ¶
func (s *Store) Collection(collection string) *mongo.Collection
Get collection with given name
func (*Store) DropCollection ¶
Drops selected collection from database
func (*Store) DropDatabase ¶
Drops the whole database
func (*Store) EnsureIndex ¶
func (*Store) SetOnClear ¶
Set the function called on Clear
Click to show internal directories.
Click to hide internal directories.