Documentation
¶
Index ¶
- Variables
- type Storage
- func (m *Storage) Close() error
- func (m *Storage) CountOfflineMessages(_ context.Context, username string) (int, error)
- func (m *Storage) DeleteBlockListItem(_ context.Context, item *model.BlockListItem) error
- func (m *Storage) DeleteNode(_ context.Context, host, name string) error
- func (m *Storage) DeleteNodeAffiliation(_ context.Context, jid, host, name string) error
- func (m *Storage) DeleteNodeSubscription(_ context.Context, jid, host, name string) error
- func (m *Storage) DeleteOfflineMessages(_ context.Context, username string) error
- func (m *Storage) DeleteRosterItem(_ context.Context, user, contact string) (rostermodel.Version, error)
- func (m *Storage) DeleteRosterNotification(_ context.Context, contact, jid string) error
- func (m *Storage) DeleteUser(_ context.Context, username string) error
- func (m *Storage) DisableMockedError()
- func (m *Storage) EnableMockedError()
- func (m *Storage) EnableMockedErrorWithInvokeLimit(invokeLimit int32)
- func (m *Storage) FetchBlockListItems(_ context.Context, username string) ([]model.BlockListItem, error)
- func (m *Storage) FetchCapabilities(_ context.Context, node, ver string) (*model.Capabilities, error)
- func (m *Storage) FetchHosts(_ context.Context) ([]string, error)
- func (m *Storage) FetchNode(_ context.Context, host, name string) (*pubsubmodel.Node, error)
- func (m *Storage) FetchNodeAffiliation(ctx context.Context, host, name, jid string) (*pubsubmodel.Affiliation, error)
- func (m *Storage) FetchNodeAffiliations(_ context.Context, host, name string) ([]pubsubmodel.Affiliation, error)
- func (m *Storage) FetchNodeItems(_ context.Context, host, name string) ([]pubsubmodel.Item, error)
- func (m *Storage) FetchNodeItemsWithIDs(_ context.Context, host, name string, identifiers []string) ([]pubsubmodel.Item, error)
- func (m *Storage) FetchNodeLastItem(_ context.Context, host, name string) (*pubsubmodel.Item, error)
- func (m *Storage) FetchNodeSubscriptions(_ context.Context, host, name string) ([]pubsubmodel.Subscription, error)
- func (m *Storage) FetchNodes(_ context.Context, host string) ([]pubsubmodel.Node, error)
- func (m *Storage) FetchOfflineMessages(_ context.Context, username string) ([]xmpp.Message, error)
- func (m *Storage) FetchPrivateXML(_ context.Context, namespace string, username string) ([]xmpp.XElement, error)
- func (m *Storage) FetchRosterGroups(_ context.Context, username string) ([]string, error)
- func (m *Storage) FetchRosterItem(_ context.Context, user, contact string) (*rostermodel.Item, error)
- func (m *Storage) FetchRosterItems(_ context.Context, user string) ([]rostermodel.Item, rostermodel.Version, error)
- func (m *Storage) FetchRosterItemsInGroups(_ context.Context, username string, groups []string) ([]rostermodel.Item, rostermodel.Version, error)
- func (m *Storage) FetchRosterNotification(_ context.Context, contact string, jid string) (*rostermodel.Notification, error)
- func (m *Storage) FetchRosterNotifications(_ context.Context, contact string) ([]rostermodel.Notification, error)
- func (m *Storage) FetchSubscribedNodes(_ context.Context, jid string) ([]pubsubmodel.Node, error)
- func (m *Storage) FetchUser(_ context.Context, username string) (*model.User, error)
- func (m *Storage) FetchVCard(_ context.Context, username string) (xmpp.XElement, error)
- func (m *Storage) InsertBlockListItem(_ context.Context, item *model.BlockListItem) error
- func (m *Storage) InsertCapabilities(_ context.Context, caps *model.Capabilities) error
- func (m *Storage) InsertOfflineMessage(_ context.Context, message *xmpp.Message, username string) error
- func (m *Storage) IsClusterCompatible() bool
- func (m *Storage) UpsertNode(_ context.Context, node *pubsubmodel.Node) error
- func (m *Storage) UpsertNodeAffiliation(_ context.Context, affiliation *pubsubmodel.Affiliation, host, name string) error
- func (m *Storage) UpsertNodeItem(_ context.Context, item *pubsubmodel.Item, host, name string, maxNodeItems int) error
- func (m *Storage) UpsertNodeSubscription(_ context.Context, subscription *pubsubmodel.Subscription, host, name string) error
- func (m *Storage) UpsertPrivateXML(_ context.Context, privateXML []xmpp.XElement, namespace string, ...) error
- func (m *Storage) UpsertRosterItem(_ context.Context, ri *rostermodel.Item) (rostermodel.Version, error)
- func (m *Storage) UpsertRosterNotification(_ context.Context, rn *rostermodel.Notification) error
- func (m *Storage) UpsertUser(_ context.Context, user *model.User) error
- func (m *Storage) UpsertVCard(_ context.Context, vCard xmpp.XElement, username string) error
- func (m *Storage) UserExists(_ context.Context, username string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var ErrMockedError = errors.New("memstorage: mocked error")
ErrMockedError will be returned by any Storage method when mocked error is activated.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage represents an in memory storage sub system.
func (*Storage) CountOfflineMessages ¶
CountOfflineMessages returns current length of user's offline queue.
func (*Storage) DeleteBlockListItem ¶ added in v0.7.0
DeleteBlockListItem deletes a of block list item entity from storage.
func (*Storage) DeleteNode ¶ added in v0.7.0
func (*Storage) DeleteNodeAffiliation ¶ added in v0.7.0
func (*Storage) DeleteNodeSubscription ¶ added in v0.7.0
func (*Storage) DeleteOfflineMessages ¶
DeleteOfflineMessages clears a user offline queue.
func (*Storage) DeleteRosterItem ¶
func (m *Storage) DeleteRosterItem(_ context.Context, user, contact string) (rostermodel.Version, error)
DeleteRosterItem deletes a roster item entity from storage.
func (*Storage) DeleteRosterNotification ¶
DeleteRosterNotification deletes a roster notification entity from storage.
func (*Storage) DeleteUser ¶
DeleteUser deletes a user entity from storage.
func (*Storage) DisableMockedError ¶ added in v0.3.4
func (m *Storage) DisableMockedError()
DisableMockedError disables in memory mocked error.
func (*Storage) EnableMockedError ¶ added in v0.3.4
func (m *Storage) EnableMockedError()
EnableMockedError enables in memory mocked error.
func (*Storage) EnableMockedErrorWithInvokeLimit ¶ added in v0.3.4
EnableMockedErrorWithInvokeLimit enables in memory mocked error after a given invocation limit is reached.
func (*Storage) FetchBlockListItems ¶
func (m *Storage) FetchBlockListItems(_ context.Context, username string) ([]model.BlockListItem, error)
FetchBlockListItems retrieves from storage all block list item entities associated to a given user.
func (*Storage) FetchCapabilities ¶ added in v0.7.0
func (*Storage) FetchHosts ¶ added in v0.7.0
func (*Storage) FetchNodeAffiliation ¶ added in v0.7.0
func (m *Storage) FetchNodeAffiliation(ctx context.Context, host, name, jid string) (*pubsubmodel.Affiliation, error)
func (*Storage) FetchNodeAffiliations ¶ added in v0.7.0
func (m *Storage) FetchNodeAffiliations(_ context.Context, host, name string) ([]pubsubmodel.Affiliation, error)
func (*Storage) FetchNodeItems ¶ added in v0.7.0
func (*Storage) FetchNodeItemsWithIDs ¶ added in v0.7.0
func (*Storage) FetchNodeLastItem ¶ added in v0.7.0
func (*Storage) FetchNodeSubscriptions ¶ added in v0.7.0
func (m *Storage) FetchNodeSubscriptions(_ context.Context, host, name string) ([]pubsubmodel.Subscription, error)
func (*Storage) FetchNodes ¶ added in v0.7.0
func (*Storage) FetchOfflineMessages ¶
FetchOfflineMessages retrieves from storage current user offline queue.
func (*Storage) FetchPrivateXML ¶
func (m *Storage) FetchPrivateXML(_ context.Context, namespace string, username string) ([]xmpp.XElement, error)
FetchPrivateXML retrieves from storage a private element.
func (*Storage) FetchRosterGroups ¶ added in v0.7.0
FetchRosterGroups retrieves all groups associated to a user roster
func (*Storage) FetchRosterItem ¶
func (m *Storage) FetchRosterItem(_ context.Context, user, contact string) (*rostermodel.Item, error)
FetchRosterItem retrieves from storage a roster item entity.
func (*Storage) FetchRosterItems ¶
func (m *Storage) FetchRosterItems(_ context.Context, user string) ([]rostermodel.Item, rostermodel.Version, error)
FetchRosterItems retrieves from storage all roster item entities associated to a given user.
func (*Storage) FetchRosterItemsInGroups ¶ added in v0.4.10
func (m *Storage) FetchRosterItemsInGroups(_ 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 (*Storage) FetchRosterNotification ¶ added in v0.3.0
func (m *Storage) FetchRosterNotification(_ context.Context, contact string, jid string) (*rostermodel.Notification, error)
FetchRosterNotification retrieves from storage a roster notification entity.
func (*Storage) FetchRosterNotifications ¶
func (m *Storage) FetchRosterNotifications(_ context.Context, contact string) ([]rostermodel.Notification, error)
FetchRosterNotifications retrieves from storage all roster notifications associated to a given user.
func (*Storage) FetchSubscribedNodes ¶ added in v0.7.0
func (*Storage) FetchVCard ¶
FetchVCard retrieves from storage a vCard element associated to a given user.
func (*Storage) InsertBlockListItem ¶ added in v0.7.0
InsertBlockListItem a block list item entity into storage, only in case they haven't been previously inserted.
func (*Storage) InsertCapabilities ¶ added in v0.7.0
func (*Storage) InsertOfflineMessage ¶
func (m *Storage) InsertOfflineMessage(_ context.Context, message *xmpp.Message, username string) error
InsertOfflineMessage inserts a new message element into user's offline queue.
func (*Storage) IsClusterCompatible ¶ added in v0.4.0
IsClusterCompatible returns whether or not the underlying storage subsystem can be used in cluster mode.
func (*Storage) UpsertNode ¶ added in v0.7.0
func (*Storage) UpsertNodeAffiliation ¶ added in v0.7.0
func (m *Storage) UpsertNodeAffiliation(_ context.Context, affiliation *pubsubmodel.Affiliation, host, name string) error
func (*Storage) UpsertNodeItem ¶ added in v0.7.0
func (*Storage) UpsertNodeSubscription ¶ added in v0.7.0
func (m *Storage) UpsertNodeSubscription(_ context.Context, subscription *pubsubmodel.Subscription, host, name string) error
func (*Storage) UpsertPrivateXML ¶ added in v0.7.0
func (m *Storage) UpsertPrivateXML(_ 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 (*Storage) UpsertRosterItem ¶ added in v0.7.0
func (m *Storage) UpsertRosterItem(_ 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 (*Storage) UpsertRosterNotification ¶ added in v0.7.0
func (m *Storage) UpsertRosterNotification(_ 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 (*Storage) 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 (*Storage) UpsertVCard ¶ added in v0.7.0
UpsertVCard inserts a new vCard element into storage, or updates it in case it's been previously inserted.