Documentation ¶
Index ¶
- Variables
- func DisableMockedError()
- func EnableMockedError()
- func EnableMockedErrorWithInvokeLimit(limit int32)
- func New() (repository.Container, error)
- type BlockList
- type Offline
- func (m *Offline) CountOfflineMessages(_ context.Context, username string) (int, error)
- func (m *Offline) DeleteOfflineMessages(_ context.Context, username string) error
- func (m *Offline) FetchOfflineMessages(_ context.Context, username string) ([]xmpp.Message, error)
- func (m *Offline) InsertOfflineMessage(_ context.Context, message *xmpp.Message, username string) error
- type Presences
- func (m *Presences) ClearPresences(_ context.Context) error
- func (m *Presences) DeleteAllocationPresences(ctx context.Context, _ string) error
- func (m *Presences) DeletePresence(_ context.Context, jid *jid.JID) error
- func (m *Presences) FetchCapabilities(_ context.Context, node, ver string) (*capsmodel.Capabilities, error)
- func (m *Presences) FetchPresence(_ context.Context, jid *jid.JID) (*capsmodel.PresenceCaps, error)
- func (m *Presences) FetchPresencesMatchingJID(ctx context.Context, j *jid.JID) ([]capsmodel.PresenceCaps, error)
- func (m *Presences) UpsertCapabilities(_ context.Context, caps *capsmodel.Capabilities) error
- func (m *Presences) UpsertPresence(_ context.Context, presence *xmpp.Presence, jid *jid.JID, allocationID string) (inserted bool, err error)
- type Private
- type PubSub
- func (m *PubSub) DeleteNode(_ context.Context, host, name string) error
- func (m *PubSub) DeleteNodeAffiliation(_ context.Context, jid, host, name string) error
- func (m *PubSub) DeleteNodeSubscription(_ context.Context, jid, host, name string) error
- func (m *PubSub) FetchHosts(_ context.Context) ([]string, error)
- func (m *PubSub) FetchNode(_ context.Context, host, name string) (*pubsubmodel.Node, error)
- func (m *PubSub) FetchNodeAffiliation(ctx context.Context, host, name, jid string) (*pubsubmodel.Affiliation, error)
- func (m *PubSub) FetchNodeAffiliations(_ context.Context, host, name string) ([]pubsubmodel.Affiliation, error)
- func (m *PubSub) FetchNodeItems(_ context.Context, host, name string) ([]pubsubmodel.Item, error)
- func (m *PubSub) FetchNodeItemsWithIDs(_ context.Context, host, name string, identifiers []string) ([]pubsubmodel.Item, error)
- func (m *PubSub) FetchNodeLastItem(_ context.Context, host, name string) (*pubsubmodel.Item, error)
- func (m *PubSub) FetchNodeSubscriptions(_ context.Context, host, name string) ([]pubsubmodel.Subscription, error)
- func (m *PubSub) FetchNodes(_ context.Context, host string) ([]pubsubmodel.Node, error)
- func (m *PubSub) FetchSubscribedNodes(_ context.Context, jid string) ([]pubsubmodel.Node, error)
- func (m *PubSub) UpsertNode(_ context.Context, node *pubsubmodel.Node) error
- func (m *PubSub) UpsertNodeAffiliation(_ context.Context, affiliation *pubsubmodel.Affiliation, host, name string) error
- func (m *PubSub) UpsertNodeItem(_ context.Context, item *pubsubmodel.Item, host, name string, maxNodeItems int) error
- func (m *PubSub) UpsertNodeSubscription(_ context.Context, subscription *pubsubmodel.Subscription, host, name string) error
- type Room
- func (r *Room) CountRooms(ctx context.Context) (int, error)
- func (r *Room) FetchQCStream(ctx context.Context, username string) (*roomsmodel.VideoStream, error)
- func (r *Room) FetchRoom(ctx context.Context, username string) (*roomsmodel.Room, error)
- func (r *Room) FetchRooms(ctx context.Context, page int, pageSize int) ([]roomsmodel.Room, error)
- type Roster
- func (m *Roster) DeleteRosterItem(_ context.Context, user, contact string) (rostermodel.Version, error)
- func (m *Roster) DeleteRosterNotification(_ context.Context, contact, jid string) error
- func (m *Roster) FetchRosterGroups(_ context.Context, username string) ([]string, error)
- func (m *Roster) FetchRosterItem(_ context.Context, username, contact string) (*rostermodel.Item, error)
- func (m *Roster) FetchRosterItems(_ context.Context, username string) ([]rostermodel.Item, rostermodel.Version, error)
- func (m *Roster) FetchRosterItemsInGroups(_ context.Context, username string, groups []string) ([]rostermodel.Item, rostermodel.Version, error)
- func (m *Roster) FetchRosterNotification(_ context.Context, contact string, jid string) (*rostermodel.Notification, error)
- func (m *Roster) FetchRosterNotifications(_ context.Context, contact string) ([]rostermodel.Notification, error)
- func (m *Roster) UpsertRosterItem(ctx context.Context, ri *rostermodel.Item) (rostermodel.Version, error)
- func (m *Roster) UpsertRosterNotification(_ context.Context, rn *rostermodel.Notification) error
- type User
- type VCard
Constants ¶
This section is empty.
Variables ¶
var ErrMocked = errors.New("memstorage: mocked erro")
ErrMocked represents in memory mocked error value.
Functions ¶
func DisableMockedError ¶
func DisableMockedError()
DisableMockedError disables in memory mocked error.
func EnableMockedErrorWithInvokeLimit ¶
func EnableMockedErrorWithInvokeLimit(limit int32)
EnableMockedErrorWithInvokeLimit enables in memory mocked error after a given invocation limit is reached.
func New ¶
func New() (repository.Container, error)
New initializes in-memory storage and returns associated container.
Types ¶
type BlockList ¶
type BlockList struct {
// contains filtered or unexported fields
}
BlockList represents an in-memory block-list storage.
func NewBlockList ¶
func NewBlockList() *BlockList
NewBlockList returns an instance of BlockList in-memory storage.
func (*BlockList) DeleteBlockListItem ¶
DeleteBlockListItem deletes a block list item entity from storage.
func (*BlockList) FetchBlockListItems ¶
func (m *BlockList) FetchBlockListItems(_ context.Context, username string) ([]model.BlockListItem, error)
FetchBlockListItems retrieves from storage all block list item entities associated to a given user.
func (*BlockList) InsertBlockListItem ¶
InsertBlockListItem inserts a block list item entity into storage if not previously inserted.
type Offline ¶
type Offline struct {
// contains filtered or unexported fields
}
Offline represents an in-memory offline storage.
func NewOffline ¶
func NewOffline() *Offline
NewOffline returns an instance of Offline in-memory storage.
func (*Offline) CountOfflineMessages ¶
CountOfflineMessages returns current length of user's offline queue.
func (*Offline) DeleteOfflineMessages ¶
DeleteOfflineMessages clears a user offline queue.
func (*Offline) FetchOfflineMessages ¶
FetchOfflineMessages retrieves from storage current user offline queue.
type Presences ¶
type Presences struct {
// contains filtered or unexported fields
}
Presences represents an in-memory presences storage.
func NewPresences ¶
func NewPresences() *Presences
NewPresences returns an instance of Presences in-memory storage.
func (*Presences) ClearPresences ¶
ClearPresences wipes out all storage presences.
func (*Presences) DeleteAllocationPresences ¶
DeleteAllocationPresences removes from storage all presences associated to a given allocation.
func (*Presences) DeletePresence ¶
DeletePresence removes from storage a concrete registered presence.
func (*Presences) FetchCapabilities ¶
func (m *Presences) FetchCapabilities(_ context.Context, node, ver string) (*capsmodel.Capabilities, error)
FetchCapabilities fetches capabilities associated to a give node and ver.
func (*Presences) FetchPresence ¶
FetchPresence retrieves from storage a previously registered presence.
func (*Presences) FetchPresencesMatchingJID ¶
func (m *Presences) FetchPresencesMatchingJID(ctx context.Context, j *jid.JID) ([]capsmodel.PresenceCaps, error)
FetchPresencesMatchingJID retrives all storage presences matching a certain JID
func (*Presences) UpsertCapabilities ¶
UpsertCapabilities inserts capabilities associated to a node+ver pair, or updates them if previously inserted..
func (*Presences) UpsertPresence ¶
func (m *Presences) UpsertPresence(_ context.Context, presence *xmpp.Presence, jid *jid.JID, allocationID string) (inserted bool, err error)
UpsertPresence inserts or updates a presence and links it to certain allocation. On insertion 'inserted' return parameter will be true.
type Private ¶
type Private struct {
// contains filtered or unexported fields
}
Private represents an in-memory private storage.
func NewPrivate ¶
func NewPrivate() *Private
NewPrivate returns an instance of Private in-memory storage.
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
PubSub represents an in-memory pubsub storage.
func NewPubSub ¶
func NewPubSub() *PubSub
NewPubSub returns an instance of PubSub in-memory storage.
func (*PubSub) DeleteNode ¶
DeleteNode deletes a pubsub node from storage.
func (*PubSub) DeleteNodeAffiliation ¶
DeleteNodeAffiliation deletes a pubsub node affiliation from storage.
func (*PubSub) DeleteNodeSubscription ¶
DeleteNodeSubscription deletes a pubsub node subscription from storage.
func (*PubSub) FetchHosts ¶
FetchHosts returns all host identifiers.
func (*PubSub) FetchNodeAffiliation ¶
func (m *PubSub) FetchNodeAffiliation(ctx context.Context, host, name, jid string) (*pubsubmodel.Affiliation, error)
FetchNodeAffiliation retrieves a concrete node affiliation from storage.
func (*PubSub) FetchNodeAffiliations ¶
func (m *PubSub) FetchNodeAffiliations(_ context.Context, host, name string) ([]pubsubmodel.Affiliation, error)
FetchNodeAffiliations retrieves all affiliations associated to a node.
func (*PubSub) FetchNodeItems ¶
FetchNodeItems retrieves all items associated to a node.
func (*PubSub) FetchNodeItemsWithIDs ¶
func (m *PubSub) FetchNodeItemsWithIDs(_ context.Context, host, name string, identifiers []string) ([]pubsubmodel.Item, error)
FetchNodeItemsWithIDs retrieves all items matching any of the passed identifiers.
func (*PubSub) FetchNodeLastItem ¶
FetchNodeLastItem retrieves last published node item.
func (*PubSub) FetchNodeSubscriptions ¶
func (m *PubSub) FetchNodeSubscriptions(_ context.Context, host, name string) ([]pubsubmodel.Subscription, error)
FetchNodeSubscriptions retrieves all subscriptions associated to a node.
func (*PubSub) FetchNodes ¶
FetchNodes retrieves from storage all node entities associated with a host.
func (*PubSub) FetchSubscribedNodes ¶
FetchSubscribedNodes retrieves from storage all nodes to which a given jid is subscribed.
func (*PubSub) UpsertNode ¶
UpsertNode inserts a new pubsub node entity into storage, or updates it if previously inserted.
func (*PubSub) UpsertNodeAffiliation ¶
func (m *PubSub) UpsertNodeAffiliation(_ context.Context, affiliation *pubsubmodel.Affiliation, host, name string) error
UpsertNodeAffiliation inserts a new pubsub node affiliation into storage, or updates it if previously inserted.
func (*PubSub) UpsertNodeItem ¶
func (m *PubSub) UpsertNodeItem(_ context.Context, item *pubsubmodel.Item, host, name string, maxNodeItems int) error
UpsertNodeItem inserts a new pubsub node item entity into storage, or updates it if previously inserted.
func (*PubSub) UpsertNodeSubscription ¶
func (m *PubSub) UpsertNodeSubscription(_ context.Context, subscription *pubsubmodel.Subscription, host, name string) error
UpsertNodeSubscription inserts a new pubsub node subscription into storage, or updates it if previously inserted.
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
Room represents an in-memory room storage.
func (*Room) CountRooms ¶
CountRooms returns current size of rooms.
func (*Room) FetchQCStream ¶
func (r *Room) FetchQCStream(ctx context.Context, username string) (*roomsmodel.VideoStream, error)
FetchQCStream retrieves qc room stream entites from storage.
func (*Room) FetchRooms ¶
FetchRooms retrieves room entites from storage.
type Roster ¶
type Roster struct {
// contains filtered or unexported fields
}
Roster represents an in-memory roster storage.
func NewRoster ¶
func NewRoster() *Roster
NewRoster returns an instance of Roster in-memory storage.
func (*Roster) DeleteRosterItem ¶
func (m *Roster) DeleteRosterItem(_ context.Context, user, contact string) (rostermodel.Version, error)
DeleteRosterItem deletes a roster item entity from storage.
func (*Roster) DeleteRosterNotification ¶
DeleteRosterNotification deletes a roster notification entity from storage.
func (*Roster) FetchRosterGroups ¶
FetchRosterGroups retrieves all groups associated to a user roster.
func (*Roster) FetchRosterItem ¶
func (m *Roster) FetchRosterItem(_ context.Context, username, contact string) (*rostermodel.Item, error)
FetchRosterItem retrieves from storage a roster item entity.
func (*Roster) FetchRosterItems ¶
func (m *Roster) FetchRosterItems(_ context.Context, username string) ([]rostermodel.Item, rostermodel.Version, error)
FetchRosterItems retrieves from storage all roster item entities associated to a given user.
func (*Roster) FetchRosterItemsInGroups ¶
func (m *Roster) 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 (*Roster) FetchRosterNotification ¶
func (m *Roster) FetchRosterNotification(_ context.Context, contact string, jid string) (*rostermodel.Notification, error)
FetchRosterNotification retrieves from storage a roster notification entity.
func (*Roster) FetchRosterNotifications ¶
func (m *Roster) FetchRosterNotifications(_ context.Context, contact string) ([]rostermodel.Notification, error)
FetchRosterNotifications retrieves from storage all roster notifications associated to a given user.
func (*Roster) UpsertRosterItem ¶
func (m *Roster) UpsertRosterItem(ctx context.Context, ri *rostermodel.Item) (rostermodel.Version, error)
UpsertRosterItem inserts a new roster item entity into storage, or updates it if previously inserted.
func (*Roster) UpsertRosterNotification ¶
func (m *Roster) UpsertRosterNotification(_ context.Context, rn *rostermodel.Notification) error
UpsertRosterNotification inserts a new roster notification entity into storage, or updates it if previously inserted.
type User ¶
type User struct {
// contains filtered or unexported fields
}
User represents an in-memory user storage.
func (*User) DeleteUser ¶
DeleteUser deletes a user entity from storage.
func (*User) UpsertUser ¶
UpsertUser inserts a new user entity into storage, or updates it if previously inserted.
type VCard ¶
type VCard struct {
// contains filtered or unexported fields
}
VCard represents an in-memory vCard storage.
func (*VCard) FetchVCard ¶
FetchVCard retrieves from storage a vCard element associated to a given user.