Documentation
¶
Index ¶
- func CountOfflineMessages(username string) (int, error)
- func DeleteBlockListItem(item *model.BlockListItem) error
- func DeleteNode(host, name string) error
- func DeleteNodeAffiliation(jid, host, name string) error
- func DeleteNodeSubscription(jid, host, name string) 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 FetchCapabilities(node, ver string) (*model.Capabilities, error)
- func FetchHosts() (hosts []string, err error)
- func FetchNode(host, name string) (*pubsubmodel.Node, error)
- func FetchNodeAffiliation(host, name, jid string) (*pubsubmodel.Affiliation, error)
- func FetchNodeAffiliations(host, name string) ([]pubsubmodel.Affiliation, error)
- func FetchNodeItems(host, name string) ([]pubsubmodel.Item, error)
- func FetchNodeItemsWithIDs(host, name string, identifiers []string) ([]pubsubmodel.Item, error)
- func FetchNodeLastItem(host, name string) (*pubsubmodel.Item, error)
- func FetchNodeSubscriptions(host, name string) ([]pubsubmodel.Subscription, error)
- func FetchNodes(host string) ([]pubsubmodel.Node, error)
- func FetchOfflineMessages(username string) ([]xmpp.Message, error)
- func FetchPrivateXML(namespace string, username string) ([]xmpp.XElement, error)
- func FetchRosterGroups(username string) ([]string, error)
- func FetchRosterItem(username, jid string) (*rostermodel.Item, error)
- func FetchRosterItems(username string) ([]rostermodel.Item, rostermodel.Version, error)
- func FetchRosterItemsInGroups(username string, groups []string) ([]rostermodel.Item, rostermodel.Version, error)
- func FetchRosterNotification(contact string, jid string) (*rostermodel.Notification, error)
- func FetchRosterNotifications(contact string) ([]rostermodel.Notification, error)
- func FetchSubscribedNodes(jid string) ([]pubsubmodel.Node, error)
- func FetchUser(username string) (*model.User, error)
- func FetchVCard(username string) (xmpp.XElement, error)
- func InsertBlockListItem(item *model.BlockListItem) error
- func InsertCapabilities(caps *model.Capabilities) error
- func InsertOfflineMessage(message *xmpp.Message, username string) error
- func InsertOrUpdatePrivateXML(privateXML []xmpp.XElement, namespace string, username string) error
- func IsClusterCompatible() bool
- func Set(storage Storage)
- func Unset()
- func UpsertNode(node *pubsubmodel.Node) error
- func UpsertNodeAffiliation(affiliation *pubsubmodel.Affiliation, host, name string) error
- func UpsertNodeItem(item *pubsubmodel.Item, host, name string, maxNodeItems int) error
- func UpsertNodeSubscription(subscription *pubsubmodel.Subscription, host, name string) error
- func UpsertRosterItem(ri *rostermodel.Item) (rostermodel.Version, error)
- func UpsertRosterNotification(rn *rostermodel.Notification) error
- func UpsertUser(user *model.User) error
- func UpsertVCard(vCard xmpp.XElement, username string) error
- func UserExists(username string) (bool, error)
- type Config
- type Storage
- type Type
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 DeleteBlockListItem ¶ added in v0.7.0
func DeleteBlockListItem(item *model.BlockListItem) error
DeleteBlockListItem deletes a block list item entity from storage.
func DeleteNode ¶ added in v0.7.0
func DeleteNodeAffiliation ¶ added in v0.7.0
func DeleteNodeSubscription ¶ added in v0.7.0
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 FetchCapabilities ¶ added in v0.7.0
func FetchCapabilities(node, ver string) (*model.Capabilities, error)
func FetchHosts ¶ added in v0.7.0
func FetchNodeAffiliation ¶ added in v0.7.0
func FetchNodeAffiliation(host, name, jid string) (*pubsubmodel.Affiliation, error)
func FetchNodeAffiliations ¶ added in v0.7.0
func FetchNodeAffiliations(host, name string) ([]pubsubmodel.Affiliation, error)
func FetchNodeItems ¶ added in v0.7.0
func FetchNodeItems(host, name string) ([]pubsubmodel.Item, error)
func FetchNodeItemsWithIDs ¶ added in v0.7.0
func FetchNodeItemsWithIDs(host, name string, identifiers []string) ([]pubsubmodel.Item, error)
func FetchNodeLastItem ¶ added in v0.7.0
func FetchNodeLastItem(host, name string) (*pubsubmodel.Item, error)
func FetchNodeSubscriptions ¶ added in v0.7.0
func FetchNodeSubscriptions(host, name string) ([]pubsubmodel.Subscription, error)
func FetchNodes ¶ added in v0.7.0
func FetchNodes(host string) ([]pubsubmodel.Node, error)
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 FetchRosterGroups ¶ added in v0.7.0
FetchRosterGroups retrieves all groups associated to a user roster
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 FetchRosterItemsInGroups ¶ added in v0.4.10
func FetchRosterItemsInGroups(username string, groups []string) ([]rostermodel.Item, rostermodel.Version, error)
FetchRosterItemsInGroups retrieves from storage all roster item entities associated to a given user and a set of groups.
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 FetchSubscribedNodes ¶ added in v0.7.0
func FetchSubscribedNodes(jid string) ([]pubsubmodel.Node, error)
func FetchVCard ¶ added in v0.3.4
FetchVCard retrieves from storage a vCard element associated to a given user.
func InsertBlockListItem ¶ added in v0.7.0
func InsertBlockListItem(item *model.BlockListItem) error
InsertBlockListItem inserts a block list item entity into storage, only in case they haven't been previously inserted.
func InsertCapabilities ¶ added in v0.7.0
func InsertCapabilities(caps *model.Capabilities) error
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
UpsertPrivateXML inserts a new private element into storage, or updates it in case it's been previously inserted.
func IsClusterCompatible ¶ added in v0.4.0
func IsClusterCompatible() bool
IsClusterCompatible returns whether or not the underlying storage subsystem can be used in cluster mode.
func UpsertNode ¶ added in v0.7.0
func UpsertNode(node *pubsubmodel.Node) error
func UpsertNodeAffiliation ¶ added in v0.7.0
func UpsertNodeAffiliation(affiliation *pubsubmodel.Affiliation, host, name string) error
func UpsertNodeItem ¶ added in v0.7.0
func UpsertNodeItem(item *pubsubmodel.Item, host, name string, maxNodeItems int) error
func UpsertNodeSubscription ¶ added in v0.7.0
func UpsertNodeSubscription(subscription *pubsubmodel.Subscription, host, name string) error
func UpsertRosterItem ¶ added in v0.7.0
func UpsertRosterItem(ri *rostermodel.Item) (rostermodel.Version, error)
UpsertRosterItem inserts a new roster item entity into storage, or updates it in case it's been previously inserted.
func UpsertRosterNotification ¶ added in v0.7.0
func UpsertRosterNotification(rn *rostermodel.Notification) error
UpsertRosterNotification inserts a new roster notification entity into storage, or updates it in case it's been previously inserted.
func UpsertUser ¶ added in v0.7.0
UpsertUser inserts a new user entity into storage, or updates it in case it's been previously inserted.
func UpsertVCard ¶ added in v0.7.0
UpsertVCard 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 Type
MySQL *mysql.Config
PostgreSQL *pgsql.Config
BadgerDB *badgerdb.Config
}
Config represents an storage manager configuration.
func (*Config) UnmarshalYAML ¶ added in v0.2.0
UnmarshalYAML satisfies Unmarshaler interface.
type Storage ¶
type Storage interface {
Close() error
IsClusterCompatible() bool
// contains filtered or unexported methods
}
Storage represents an entity storage interface.
var Disabled Storage = &disabledStorage{}
Disabled stores a disabled storage instance.