Documentation ¶
Overview ¶
Package cache provides a temporary persistence layer for development purposes
Index ¶
- type Cache
- func (c *Cache) AdminGetList() (result []types.Admin, err error)
- func (c *Cache) AdminSetLevel(id bson.ObjectId, level int32) (err error)
- func (c *Cache) DeleteEverythingPermanently() (err error)
- func (c *Cache) PlayerCreate(player types.Player) (id bson.ObjectId, err error)
- func (c *Cache) PlayerGetByID(id bson.ObjectId) (player types.Player, err error)
- func (c *Cache) PlayerGetByName(name string) (player types.Player, err error)
- func (c *Cache) PlayerRemove(id bson.ObjectId) (err error)
- func (c *Cache) PlayerUpdate(id bson.ObjectId, player types.Player) (err error)
- func (c *Cache) ReportArchive(id bson.ObjectId, archived bool) (err error)
- func (c *Cache) ReportCreate(report types.Report) (id bson.ObjectId, err error)
- func (c *Cache) ReportGet(id bson.ObjectId) (result types.Report, err error)
- func (c *Cache) ReportGetList(pageSize, page int, archived, noRead bool, by, of bson.ObjectId, ...) (result []types.Report, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides access to collections and predefined CRUD functionality.
func (*Cache) AdminGetList ¶
AdminGetList returns a list of all admins
func (*Cache) AdminSetLevel ¶
AdminSetLevel creates, updates or removes an admin record based on level
func (*Cache) DeleteEverythingPermanently ¶
DeleteEverythingPermanently should only be used during testing!
func (*Cache) PlayerCreate ¶
PlayerCreate creates a new player account in the database
func (*Cache) PlayerGetByID ¶
PlayerGetByID returns a player object by ID
func (*Cache) PlayerGetByName ¶
PlayerGetByName returns a player object by name
func (*Cache) PlayerRemove ¶
PlayerRemove removes a player in the database by their ID
func (*Cache) PlayerUpdate ¶
PlayerUpdate updates a player in the database by their ID
func (*Cache) ReportArchive ¶
ReportArchive sets archive status on a report
func (*Cache) ReportCreate ¶
ReportCreate creates a report in the database