Documentation ¶
Index ¶
- func CountOfflineMessages(username string) (int, error)
- func DeleteBlockListItems(items []model.BlockListItem) error
- func DeleteOfflineMessages(username string) error
- func DeleteRosterItem(username, jid string) (rostermodel.Version, error)
- func DeleteRosterNotification(contact, jid string) error
- func DeleteUser(username string) error
- func FetchBlockListItems(username string) ([]model.BlockListItem, error)
- func FetchOfflineMessages(username string) ([]*xmpp.Message, error)
- func FetchPrivateXML(namespace string, username string) ([]xmpp.XElement, error)
- func FetchRosterItem(username, jid string) (*rostermodel.Item, error)
- func FetchRosterItems(username string) ([]rostermodel.Item, rostermodel.Version, error)
- func FetchRosterNotification(contact string, jid string) (*rostermodel.Notification, error)
- func FetchRosterNotifications(contact string) ([]rostermodel.Notification, error)
- func FetchUser(username string) (*model.User, error)
- func FetchVCard(username string) (xmpp.XElement, error)
- func InsertBlockListItems(items []model.BlockListItem) error
- func InsertOfflineMessage(message *xmpp.Message, username string) error
- func InsertOrUpdatePrivateXML(privateXML []xmpp.XElement, namespace string, username string) error
- func InsertOrUpdateRosterItem(ri *rostermodel.Item) (rostermodel.Version, error)
- func InsertOrUpdateRosterNotification(rn *rostermodel.Notification) error
- func InsertOrUpdateUser(user *model.User) error
- func InsertOrUpdateVCard(vCard xmpp.XElement, username string) error
- func Set(storage Storage)
- func Unset()
- func UserExists(username string) (bool, error)
- type Config
- type Storage
- type StorageType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountOfflineMessages ¶ added in v0.3.4
CountOfflineMessages returns current length of user's offline queue.
func DeleteBlockListItems ¶ added in v0.3.4
func DeleteBlockListItems(items []model.BlockListItem) error
DeleteBlockListItems deletes a set of block list item entities from storage.
func DeleteOfflineMessages ¶ added in v0.3.4
DeleteOfflineMessages clears a user offline queue.
func DeleteRosterItem ¶ added in v0.3.4
func DeleteRosterItem(username, jid string) (rostermodel.Version, error)
DeleteRosterItem deletes a roster item entity from storage.
func DeleteRosterNotification ¶ added in v0.3.4
DeleteRosterNotification deletes a roster notification entity from storage.
func DeleteUser ¶ added in v0.3.4
DeleteUser deletes a user entity from storage.
func FetchBlockListItems ¶ added in v0.3.4
func FetchBlockListItems(username string) ([]model.BlockListItem, error)
FetchBlockListItems retrieves from storage all block list item entities associated to a given user.
func FetchOfflineMessages ¶ added in v0.3.4
FetchOfflineMessages retrieves from storage current user offline queue.
func FetchPrivateXML ¶ added in v0.3.4
FetchPrivateXML retrieves from storage a private element.
func FetchRosterItem ¶ added in v0.3.4
func FetchRosterItem(username, jid string) (*rostermodel.Item, error)
FetchRosterItem retrieves from storage a roster item entity.
func FetchRosterItems ¶ added in v0.3.4
func FetchRosterItems(username string) ([]rostermodel.Item, rostermodel.Version, error)
FetchRosterItems retrieves from storage all roster item entities associated to a given user.
func FetchRosterNotification ¶ added in v0.3.4
func FetchRosterNotification(contact string, jid string) (*rostermodel.Notification, error)
FetchRosterNotification retrieves from storage a roster notification entity.
func FetchRosterNotifications ¶ added in v0.3.4
func FetchRosterNotifications(contact string) ([]rostermodel.Notification, error)
FetchRosterNotifications retrieves from storage all roster notifications associated to a given user.
func FetchVCard ¶ added in v0.3.4
FetchVCard retrieves from storage a vCard element associated to a given user.
func InsertBlockListItems ¶ added in v0.3.4
func InsertBlockListItems(items []model.BlockListItem) error
InsertBlockListItems inserts a set of block list item entities into storage, only in case they haven't been previously inserted.
func InsertOfflineMessage ¶ added in v0.3.4
InsertOfflineMessage inserts a new message element into user's offline queue.
func InsertOrUpdatePrivateXML ¶ added in v0.3.4
InsertOrUpdatePrivateXML inserts a new private element into storage, or updates it in case it's been previously inserted.
func InsertOrUpdateRosterItem ¶ added in v0.3.4
func InsertOrUpdateRosterItem(ri *rostermodel.Item) (rostermodel.Version, error)
InsertOrUpdateRosterItem inserts a new roster item entity into storage, or updates it in case it's been previously inserted.
func InsertOrUpdateRosterNotification ¶ added in v0.3.4
func InsertOrUpdateRosterNotification(rn *rostermodel.Notification) error
InsertOrUpdateRosterNotification inserts a new roster notification entity into storage, or updates it in case it's been previously inserted.
func InsertOrUpdateUser ¶ added in v0.3.4
InsertOrUpdateUser inserts a new user entity into storage, or updates it in case it's been previously inserted.
func InsertOrUpdateVCard ¶ added in v0.3.4
InsertOrUpdateVCard inserts a new vCard element into storage, or updates it in case it's been previously inserted.
func UserExists ¶ added in v0.3.4
UserExists returns whether or not a user exists within storage.
Types ¶
type Config ¶ added in v0.2.0
type Config struct { Type StorageType MySQL *sql.Config BadgerDB *badgerdb.Config }
Config represents an storage manager configuration.
func (*Config) UnmarshalYAML ¶ added in v0.2.0
UnmarshalYAML satisfies Unmarshaler interface.
type Storage ¶
Storage represents an entity storage interface.
var Disabled Storage = &disabledStorage{}
type StorageType ¶ added in v0.2.0
type StorageType int
StorageType represents a storage manager type.
const ( // MySQL represents a MySQL storage type. MySQL StorageType = iota // BadgerDB represents a BadgerDB storage type. BadgerDB // Memory represents a in-memstorage storage type. Memory )