memorystorage

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMocked = errors.New("memstorage: mocked error")

ErrMocked represents in memory mocked error value.

Functions

func DisableMockedError

func DisableMockedError()

DisableMockedError disables in memory mocked error.

func EnableMockedError

func EnableMockedError()

EnableMockedError enables 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)

Types

type BlockList

type BlockList struct {
	// contains filtered or unexported fields
}

func NewBlockList

func NewBlockList() *BlockList

func (*BlockList) DeleteBlockListItem

func (m *BlockList) DeleteBlockListItem(_ context.Context, item *model.BlockListItem) error

func (*BlockList) FetchBlockListItems

func (m *BlockList) FetchBlockListItems(_ context.Context, username string) ([]model.BlockListItem, error)

func (*BlockList) InsertBlockListItem

func (m *BlockList) InsertBlockListItem(_ context.Context, item *model.BlockListItem) error

type Capabilities

type Capabilities struct {
	// contains filtered or unexported fields
}

func NewCapabilities

func NewCapabilities() *Capabilities

func (*Capabilities) FetchCapabilities

func (m *Capabilities) FetchCapabilities(_ context.Context, node, ver string) (*model.Capabilities, error)

func (*Capabilities) UpsertCapabilities

func (m *Capabilities) UpsertCapabilities(_ context.Context, caps *model.Capabilities) error

type Offline

type Offline struct {
	// contains filtered or unexported fields
}

func NewOffline

func NewOffline() *Offline

func (*Offline) CountOfflineMessages

func (m *Offline) CountOfflineMessages(_ context.Context, username string) (int, error)

CountOfflineMessages returns current length of user's offline queue.

func (*Offline) DeleteOfflineMessages

func (m *Offline) DeleteOfflineMessages(_ context.Context, username string) error

DeleteOfflineMessages clears a user offline queue.

func (*Offline) FetchOfflineMessages

func (m *Offline) FetchOfflineMessages(_ context.Context, username string) ([]xmpp.Message, error)

FetchOfflineMessages retrieves from storage current user offline queue.

func (*Offline) InsertOfflineMessage

func (m *Offline) InsertOfflineMessage(_ context.Context, message *xmpp.Message, username string) error

InsertOfflineMessage inserts a new message element into user's offline queue.

type Private

type Private struct {
	// contains filtered or unexported fields
}

func NewPrivate

func NewPrivate() *Private

func (*Private) FetchPrivateXML

func (m *Private) FetchPrivateXML(_ context.Context, namespace string, username string) ([]xmpp.XElement, error)

FetchPrivateXML retrieves from storage a private element.

func (*Private) UpsertPrivateXML

func (m *Private) 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.

type PubSub

type PubSub struct {
	// contains filtered or unexported fields
}

func NewPubSub

func NewPubSub() *PubSub

func (*PubSub) DeleteNode

func (m *PubSub) DeleteNode(_ context.Context, host, name string) error

func (*PubSub) DeleteNodeAffiliation

func (m *PubSub) DeleteNodeAffiliation(_ context.Context, jid, host, name string) error

func (*PubSub) DeleteNodeSubscription

func (m *PubSub) DeleteNodeSubscription(_ context.Context, jid, host, name string) error

func (*PubSub) FetchHosts

func (m *PubSub) FetchHosts(_ context.Context) ([]string, error)

func (*PubSub) FetchNode

func (m *PubSub) FetchNode(_ context.Context, host, name string) (*pubsubmodel.Node, error)

func (*PubSub) FetchNodeAffiliation

func (m *PubSub) FetchNodeAffiliation(ctx context.Context, host, name, jid string) (*pubsubmodel.Affiliation, error)

func (*PubSub) FetchNodeAffiliations

func (m *PubSub) FetchNodeAffiliations(_ context.Context, host, name string) ([]pubsubmodel.Affiliation, error)

func (*PubSub) FetchNodeItems

func (m *PubSub) FetchNodeItems(_ context.Context, host, name string) ([]pubsubmodel.Item, error)

func (*PubSub) FetchNodeItemsWithIDs

func (m *PubSub) FetchNodeItemsWithIDs(_ context.Context, host, name string, identifiers []string) ([]pubsubmodel.Item, error)

func (*PubSub) FetchNodeLastItem

func (m *PubSub) FetchNodeLastItem(_ context.Context, host, name string) (*pubsubmodel.Item, error)

func (*PubSub) FetchNodeSubscriptions

func (m *PubSub) FetchNodeSubscriptions(_ context.Context, host, name string) ([]pubsubmodel.Subscription, error)

func (*PubSub) FetchNodes

func (m *PubSub) FetchNodes(_ context.Context, host string) ([]pubsubmodel.Node, error)

func (*PubSub) FetchSubscribedNodes

func (m *PubSub) FetchSubscribedNodes(_ context.Context, jid string) ([]pubsubmodel.Node, error)

func (*PubSub) UpsertNode

func (m *PubSub) UpsertNode(_ context.Context, node *pubsubmodel.Node) error

func (*PubSub) UpsertNodeAffiliation

func (m *PubSub) UpsertNodeAffiliation(_ context.Context, affiliation *pubsubmodel.Affiliation, host, name string) error

func (*PubSub) UpsertNodeItem

func (m *PubSub) UpsertNodeItem(_ context.Context, item *pubsubmodel.Item, host, name string, maxNodeItems int) error

func (*PubSub) UpsertNodeSubscription

func (m *PubSub) UpsertNodeSubscription(_ context.Context, subscription *pubsubmodel.Subscription, host, name string) error

type Roster

type Roster struct {
	// contains filtered or unexported fields
}

func NewRoster

func NewRoster() *Roster

func (*Roster) DeleteRosterItem

func (m *Roster) DeleteRosterItem(_ context.Context, user, contact string) (rostermodel.Version, error)

func (*Roster) DeleteRosterNotification

func (m *Roster) DeleteRosterNotification(_ context.Context, contact, jid string) error

func (*Roster) FetchRosterGroups

func (m *Roster) FetchRosterGroups(_ context.Context, username string) ([]string, error)

func (*Roster) FetchRosterItem

func (m *Roster) FetchRosterItem(_ context.Context, user, contact string) (*rostermodel.Item, error)

func (*Roster) FetchRosterItems

func (m *Roster) FetchRosterItems(_ context.Context, user string) ([]rostermodel.Item, rostermodel.Version, error)

func (*Roster) FetchRosterItemsInGroups

func (m *Roster) FetchRosterItemsInGroups(_ context.Context, username string, groups []string) ([]rostermodel.Item, rostermodel.Version, error)

func (*Roster) FetchRosterNotification

func (m *Roster) FetchRosterNotification(_ context.Context, contact string, jid string) (*rostermodel.Notification, error)

func (*Roster) FetchRosterNotifications

func (m *Roster) FetchRosterNotifications(_ context.Context, contact string) ([]rostermodel.Notification, error)

func (*Roster) UpsertRosterItem

func (m *Roster) UpsertRosterItem(_ context.Context, ri *rostermodel.Item) (rostermodel.Version, error)

func (*Roster) UpsertRosterNotification

func (m *Roster) UpsertRosterNotification(_ context.Context, rn *rostermodel.Notification) error

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser() *User

func (*User) DeleteUser

func (m *User) DeleteUser(_ context.Context, username string) error

DeleteUser deletes a user entity from storage.

func (*User) FetchUser

func (m *User) FetchUser(_ context.Context, username string) (*model.User, error)

FetchUser retrieves from storage a user entity.

func (*User) UpsertUser

func (m *User) UpsertUser(_ context.Context, user *model.User) error

UpsertUser inserts a new user entity into storage, or updates it in case it's been previously inserted.

func (*User) UserExists

func (m *User) UserExists(_ context.Context, username string) (bool, error)

UserExists returns whether or not a user exists within storage.

type VCard

type VCard struct {
	// contains filtered or unexported fields
}

func NewVCard

func NewVCard() *VCard

func (*VCard) FetchVCard

func (m *VCard) FetchVCard(_ context.Context, username string) (xmpp.XElement, error)

FetchVCard retrieves from storage a vCard element associated to a given user.

func (*VCard) UpsertVCard

func (m *VCard) UpsertVCard(_ context.Context, vCard xmpp.XElement, username string) error

UpsertVCard inserts a new vCard element into storage, or updates it in case it's been previously inserted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL