Documentation
¶
Index ¶
- func CountOfflineMessages(ctx context.Context, username string) (int, error)
- func DeleteBlockListItem(ctx context.Context, item *model.BlockListItem) error
- func DeleteNode(ctx context.Context, host, name string) error
- func DeleteNodeAffiliation(ctx context.Context, jid, host, name string) error
- func DeleteNodeSubscription(ctx context.Context, jid, host, name string) error
- func DeleteOfflineMessages(ctx context.Context, username string) error
- func DeleteRosterItem(ctx context.Context, username, jid string) (rostermodel.Version, error)
- func DeleteRosterNotification(ctx context.Context, contact, jid string) error
- func DeleteUser(ctx context.Context, username string) error
- func FetchBlockListItems(ctx context.Context, username string) ([]model.BlockListItem, error)
- func FetchCapabilities(ctx context.Context, node, ver string) (*model.Capabilities, error)
- func FetchHosts(ctx context.Context) (hosts []string, err error)
- func FetchNode(ctx context.Context, host, name string) (*pubsubmodel.Node, error)
- func FetchNodeAffiliation(ctx context.Context, host, name, jid string) (*pubsubmodel.Affiliation, error)
- func FetchNodeAffiliations(ctx context.Context, host, name string) ([]pubsubmodel.Affiliation, error)
- func FetchNodeItems(ctx context.Context, host, name string) ([]pubsubmodel.Item, error)
- func FetchNodeItemsWithIDs(ctx context.Context, host, name string, identifiers []string) ([]pubsubmodel.Item, error)
- func FetchNodeLastItem(ctx context.Context, host, name string) (*pubsubmodel.Item, error)
- func FetchNodeSubscriptions(ctx context.Context, host, name string) ([]pubsubmodel.Subscription, error)
- func FetchNodes(ctx context.Context, host string) ([]pubsubmodel.Node, error)
- func FetchOfflineMessages(ctx context.Context, username string) ([]xmpp.Message, error)
- func FetchPrivateXML(ctx context.Context, namespace string, username string) ([]xmpp.XElement, error)
- func FetchRosterGroups(ctx context.Context, username string) ([]string, error)
- func FetchRosterItem(ctx context.Context, username, jid string) (*rostermodel.Item, error)
- func FetchRosterItems(ctx context.Context, username string) ([]rostermodel.Item, rostermodel.Version, error)
- func FetchRosterItemsInGroups(ctx context.Context, username string, groups []string) ([]rostermodel.Item, rostermodel.Version, error)
- func FetchRosterNotification(ctx context.Context, contact string, jid string) (*rostermodel.Notification, error)
- func FetchRosterNotifications(ctx context.Context, contact string) ([]rostermodel.Notification, error)
- func FetchSubscribedNodes(ctx context.Context, jid string) ([]pubsubmodel.Node, error)
- func FetchUser(ctx context.Context, username string) (*model.User, error)
- func FetchVCard(ctx context.Context, username string) (xmpp.XElement, error)
- func InsertBlockListItem(ctx context.Context, item *model.BlockListItem) error
- func InsertCapabilities(ctx context.Context, caps *model.Capabilities) error
- func InsertOfflineMessage(ctx context.Context, message *xmpp.Message, username string) error
- func InsertOrUpdatePrivateXML(ctx context.Context, privateXML []xmpp.XElement, namespace string, ...) error
- func IsClusterCompatible() bool
- func Set(storage Storage)
- func Unset()
- func UpsertNode(ctx context.Context, node *pubsubmodel.Node) error
- func UpsertNodeAffiliation(ctx context.Context, affiliation *pubsubmodel.Affiliation, host, name string) error
- func UpsertNodeItem(ctx context.Context, item *pubsubmodel.Item, host, name string, ...) error
- func UpsertNodeSubscription(ctx context.Context, subscription *pubsubmodel.Subscription, host, name string) error
- func UpsertRosterItem(ctx context.Context, ri *rostermodel.Item) (rostermodel.Version, error)
- func UpsertRosterNotification(ctx context.Context, rn *rostermodel.Notification) error
- func UpsertUser(ctx context.Context, user *model.User) error
- func UpsertVCard(ctx context.Context, vCard xmpp.XElement, username string) error
- func UserExists(ctx context.Context, 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(ctx context.Context, item *model.BlockListItem) error
DeleteBlockListItem deletes a block list item entity from storage.
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
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
FetchBlockListItems retrieves from storage all block list item entities associated to a given user.
func FetchCapabilities ¶ added in v0.7.0
func FetchNodeAffiliation ¶ added in v0.7.0
func FetchNodeAffiliation(ctx context.Context, host, name, jid string) (*pubsubmodel.Affiliation, error)
func FetchNodeAffiliations ¶ added in v0.7.0
func FetchNodeAffiliations(ctx context.Context, host, name string) ([]pubsubmodel.Affiliation, error)
func FetchNodeItems ¶ added in v0.7.0
func FetchNodeItemsWithIDs ¶ added in v0.7.0
func FetchNodeLastItem ¶ added in v0.7.0
func FetchNodeSubscriptions ¶ added in v0.7.0
func FetchNodeSubscriptions(ctx context.Context, host, name string) ([]pubsubmodel.Subscription, error)
func FetchNodes ¶ added in v0.7.0
func FetchOfflineMessages ¶ added in v0.3.4
FetchOfflineMessages retrieves from storage current user offline queue.
func FetchPrivateXML ¶ added in v0.3.4
func FetchPrivateXML(ctx context.Context, namespace string, username string) ([]xmpp.XElement, error)
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
FetchRosterItem retrieves from storage a roster item entity.
func FetchRosterItems ¶ added in v0.3.4
func FetchRosterItems(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, contact string, jid string) (*rostermodel.Notification, error)
FetchRosterNotification retrieves from storage a roster notification entity.
func FetchRosterNotifications ¶ added in v0.3.4
func FetchRosterNotifications(ctx context.Context, 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 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(ctx context.Context, 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(ctx context.Context, 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
func InsertOrUpdatePrivateXML(ctx context.Context, privateXML []xmpp.XElement, namespace string, username string) error
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(ctx context.Context, node *pubsubmodel.Node) error
func UpsertNodeAffiliation ¶ added in v0.7.0
func UpsertNodeAffiliation(ctx context.Context, affiliation *pubsubmodel.Affiliation, host, name string) error
func UpsertNodeItem ¶ added in v0.7.0
func UpsertNodeSubscription ¶ added in v0.7.0
func UpsertNodeSubscription(ctx context.Context, subscription *pubsubmodel.Subscription, host, name string) error
func UpsertRosterItem ¶ added in v0.7.0
func UpsertRosterItem(ctx context.Context, 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(ctx context.Context, 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.
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.