Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StormCodec = storm.Codec(msgpack.Codec)
StormCodec is the format used to store data in the database.
Functions ¶
Types ¶
type Client ¶
type Client interface { // Save inserts or updates the entry in database with the given model. Save(m model.Model) error // Delete deletes the entry in database with the given model. Delete(m model.Model) error // Close the database. Close() error // IsNotFound returns true if err is nil or a not found error. IsNotFound(err error) bool UserInteraction SessionInteraction ItemInteraction }
A Client can interacts with the database.
type ItemInteraction ¶
type ItemInteraction interface { // FindItem returns the item for the given id (UUID). FindItem(id string) (*model.Item, error) // FindItemByUserID returns the item for the given id and user id (UUID). FindItemByUserID(id, userID string) (*model.Item, error) // FindItemsByParams returns all the matching records for the given parameters. // It also returns a boolean to true if there is more items than the given limit. // limit equals to 0 means all items. FindItemsByParams(userID, contentType string, updated time.Time, strictTime, filterDeleted bool, limit int) ([]*model.Item, bool, error) // FindItemsForIntegrityCheck returns valid items for computing data signature forthe given user. FindItemsForIntegrityCheck(userID string) ([]*model.Item, error) // DeleteItem deletes the item matching the given parameters. DeleteItem(id, userID string) error }
An ItemInteraction defines all the methods used to interact with a item record(s).
type SessionInteraction ¶
type SessionInteraction interface { // FindSession returns the session for the given id (UUID). FindSession(id string) (*model.Session, error) // FindSessionsByUserID returns all sessions for the given id and user id. FindSessionByUserID(id, userID string) (*model.Session, error) // FindActiveSessionsByUserID returns all active sessions for the given user id. FindActiveSessionsByUserID(userID string) ([]*model.Session, error) // FindSessionsByUserID returns all sessions for the given user id. FindSessionsByUserID(userID string) ([]*model.Session, error) // FindSessionByAccessToken returns the session for the given id and access token. FindSessionByAccessToken(id, token string) (*model.Session, error) // FindSessionByTokens returns the session for the given id, access and refresh token. FindSessionByTokens(id, access, refresh string) (*model.Session, error) }
An SessionInteraction defines all the methods used to interact with a session record.
type UserInteraction ¶
type UserInteraction interface { // FindUser returns the user for the given id (UUID). FindUser(id string) (*model.User, error) // FindUserByMail returns the user for the given email. FindUserByMail(email string) (*model.User, error) }
An UserInteraction defines all the methods used to interact with a user record.
Click to show internal directories.
Click to hide internal directories.