Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCollectionNotFound = errors.New("mongodb collection not found")
ErrCollectionNotFound signals that provided mongodb collection is not available
View Source
var ErrEmptyMongoDBName = errors.New("empty db name")
ErrEmptyMongoDBName signals that an empty db name has been provided
View Source
var ErrNilMongoDBClient = errors.New("nil mongodb client")
ErrNilMongoDBClient signals that a nil mongodb client has been provided
Functions ¶
Types ¶
type CollectionID ¶
type CollectionID string
CollectionID defines mongodb collection type
const ( // UsersCollectionID specifies mongodb collection for users UsersCollectionID CollectionID = "users" )
type MongoDBClient ¶
type MongoDBClient interface { Put(coll CollectionID, key []byte, data []byte) error Get(coll CollectionID, key []byte) ([]byte, error) Has(coll CollectionID, key []byte) error Remove(coll CollectionID, key []byte) error GetIndex(collID CollectionID, key []byte) (uint32, error) PutIndexIfNotExists(collID CollectionID, key []byte, index uint32) error IncrementIndex(collID CollectionID, key []byte) (uint32, error) GetAllCollectionsIDs() []CollectionID Close() error IsInterfaceNil() bool }
MongoDBClient defines what a mongodb client should do
func CreateMongoDBClient ¶
func CreateMongoDBClient(cfg config.MongoDBConfig, metricsHandler core.StatusMetricsHandler) (MongoDBClient, error)
CreateMongoDBClient will create a new mongo db client instance
Click to show internal directories.
Click to hide internal directories.