Documentation ¶
Index ¶
Constants ¶
View Source
const (
EntityCollectionName = "default_entities"
)
Entities constants
Variables ¶
This section is empty.
Functions ¶
func DefaultCollection ¶
func DefaultCollection(session *mgo.Session) mongo.Collection
DefaultCollection returns the default mongo collection for entities
Types ¶
type Adapter ¶
type Adapter interface { Insert(entity types.Entity) error Update(entity types.Entity) error Remove(entity types.Entity) error BulkInsert(types.Entity) error BulkUpdate(types.Entity) error FlushBulk() error FlushBulkInsert() error FlushBulkUpdate() error Get(id string) (types.Entity, bool) GetIDs(filter bson.M, ids *[]interface{}) error GetEntityByID(id string) (types.Entity, error) Count() (int, error) RemoveAll() error }
Adapter ...
func NewAdapter ¶
func NewAdapter(collection mongo.Collection) Adapter
NewAdapter gives the correct entity adapter. Give nil to the redis client and it will create a new redis.Client with the dedicated redis database for entities.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache ...
Click to show internal directories.
Click to hide internal directories.