Documentation
¶
Index ¶
- type Config
- type Storage
- func (s *Storage) Close() error
- func (s *Storage) CountOfflineMessages(ctx context.Context, username string) (int, error)
- func (s *Storage) DeleteBlockListItem(ctx context.Context, item *model.BlockListItem) error
- func (s *Storage) DeleteNode(ctx context.Context, host, name string) error
- func (s *Storage) DeleteNodeAffiliation(ctx context.Context, jid, host, name string) error
- func (s *Storage) DeleteNodeSubscription(ctx context.Context, jid, host, name string) error
- func (s *Storage) DeleteOfflineMessages(ctx context.Context, username string) error
- func (s *Storage) DeleteRosterItem(ctx context.Context, username, jid string) (rostermodel.Version, error)
- func (s *Storage) DeleteRosterNotification(ctx context.Context, contact, jid string) error
- func (s *Storage) DeleteUser(ctx context.Context, username string) error
- func (s *Storage) FetchBlockListItems(ctx context.Context, username string) ([]model.BlockListItem, error)
- func (s *Storage) FetchCapabilities(ctx context.Context, node, ver string) (*model.Capabilities, error)
- func (s *Storage) FetchHosts(ctx context.Context) ([]string, error)
- func (s *Storage) FetchNode(ctx context.Context, host, name string) (*pubsubmodel.Node, error)
- func (s *Storage) FetchNodeAffiliation(ctx context.Context, host, name, jid string) (*pubsubmodel.Affiliation, error)
- func (s *Storage) FetchNodeAffiliations(ctx context.Context, host, name string) ([]pubsubmodel.Affiliation, error)
- func (s *Storage) FetchNodeItems(ctx context.Context, host, name string) ([]pubsubmodel.Item, error)
- func (s *Storage) FetchNodeItemsWithIDs(ctx context.Context, host, name string, identifiers []string) ([]pubsubmodel.Item, error)
- func (s *Storage) FetchNodeLastItem(ctx context.Context, host, name string) (*pubsubmodel.Item, error)
- func (s *Storage) FetchNodeSubscriptions(ctx context.Context, host, name string) ([]pubsubmodel.Subscription, error)
- func (s *Storage) FetchNodes(ctx context.Context, host string) ([]pubsubmodel.Node, error)
- func (s *Storage) FetchOfflineMessages(ctx context.Context, username string) ([]xmpp.Message, error)
- func (s *Storage) FetchPrivateXML(ctx context.Context, namespace string, username string) ([]xmpp.XElement, error)
- func (s *Storage) FetchRosterGroups(ctx context.Context, username string) ([]string, error)
- func (s *Storage) FetchRosterItem(ctx context.Context, username, jid string) (*rostermodel.Item, error)
- func (s *Storage) FetchRosterItems(ctx context.Context, username string) ([]rostermodel.Item, rostermodel.Version, error)
- func (s *Storage) FetchRosterItemsInGroups(ctx context.Context, username string, groups []string) ([]rostermodel.Item, rostermodel.Version, error)
- func (s *Storage) FetchRosterNotification(ctx context.Context, contact string, jid string) (*rostermodel.Notification, error)
- func (s *Storage) FetchRosterNotifications(ctx context.Context, contact string) ([]rostermodel.Notification, error)
- func (s *Storage) FetchSubscribedNodes(ctx context.Context, jid string) ([]pubsubmodel.Node, error)
- func (s *Storage) FetchUser(ctx context.Context, username string) (*model.User, error)
- func (s *Storage) FetchVCard(ctx context.Context, username string) (xmpp.XElement, error)
- func (s *Storage) InsertBlockListItem(ctx context.Context, item *model.BlockListItem) error
- func (s *Storage) InsertCapabilities(ctx context.Context, caps *model.Capabilities) error
- func (s *Storage) InsertOfflineMessage(ctx context.Context, message *xmpp.Message, username string) error
- func (s *Storage) IsClusterCompatible() bool
- func (s *Storage) UpsertNode(ctx context.Context, node *pubsubmodel.Node) error
- func (s *Storage) UpsertNodeAffiliation(ctx context.Context, affiliation *pubsubmodel.Affiliation, host, name string) error
- func (s *Storage) UpsertNodeItem(ctx context.Context, item *pubsubmodel.Item, host, name string, ...) error
- func (s *Storage) UpsertNodeSubscription(ctx context.Context, subscription *pubsubmodel.Subscription, host, name string) error
- func (s *Storage) UpsertPrivateXML(ctx context.Context, privateXML []xmpp.XElement, namespace string, ...) error
- func (s *Storage) UpsertRosterItem(ctx context.Context, ri *rostermodel.Item) (rostermodel.Version, error)
- func (s *Storage) UpsertRosterNotification(ctx context.Context, rn *rostermodel.Notification) error
- func (s *Storage) UpsertUser(ctx context.Context, u *model.User) error
- func (s *Storage) UpsertVCard(ctx context.Context, vCard xmpp.XElement, username string) error
- func (s *Storage) UserExists(ctx context.Context, username string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Host string `yaml:"host"` User string `yaml:"user"` Password string `yaml:"password"` Database string `yaml:"database"` PoolSize int `yaml:"pool_size"` SSLMode string `yaml:"ssl_mode"` }
Config represents PostgreSQL storage configuration.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML satisfies Unmarshaler interface
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage represents a SQL 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 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 (s *Storage) DeleteRosterItem(ctx context.Context, username, jid 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) FetchBlockListItems ¶
func (s *Storage) FetchBlockListItems(ctx 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 (s *Storage) FetchNodeAffiliation(ctx context.Context, host, name, jid string) (*pubsubmodel.Affiliation, error)
func (*Storage) FetchNodeAffiliations ¶ added in v0.7.0
func (s *Storage) FetchNodeAffiliations(ctx 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 (s *Storage) FetchNodeSubscriptions(ctx context.Context, host, name string) ([]pubsubmodel.Subscription, error)
func (*Storage) FetchNodes ¶ added in v0.7.0
func (*Storage) FetchOfflineMessages ¶
func (s *Storage) FetchOfflineMessages(ctx context.Context, username string) ([]xmpp.Message, error)
FetchOfflineMessages retrieves from storage current user offline queue.
func (*Storage) FetchPrivateXML ¶
func (s *Storage) FetchPrivateXML(ctx 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 (s *Storage) FetchRosterItem(ctx context.Context, username, jid string) (*rostermodel.Item, error)
FetchRosterItem retrieves from storage a roster item entity.
func (*Storage) FetchRosterItems ¶
func (s *Storage) 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 (*Storage) FetchRosterItemsInGroups ¶ added in v0.4.10
func (s *Storage) 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 (*Storage) FetchRosterNotification ¶
func (s *Storage) FetchRosterNotification(ctx context.Context, contact string, jid string) (*rostermodel.Notification, error)
FetchRosterNotification retrieves from storage a roster notification entity.
func (*Storage) FetchRosterNotifications ¶
func (s *Storage) FetchRosterNotifications(ctx 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 inserts 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 (s *Storage) InsertOfflineMessage(ctx context.Context, message *xmpp.Message, username string) error
InsertOfflineMessage inserts a new message element into user's offline queue.
func (*Storage) IsClusterCompatible ¶
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 (s *Storage) UpsertNodeAffiliation(ctx 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 (s *Storage) UpsertNodeSubscription(ctx context.Context, subscription *pubsubmodel.Subscription, host, name string) error
func (*Storage) UpsertPrivateXML ¶ added in v0.7.0
func (s *Storage) UpsertPrivateXML(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 (*Storage) UpsertRosterItem ¶ added in v0.7.0
func (s *Storage) 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 (*Storage) UpsertRosterNotification ¶ added in v0.7.0
func (s *Storage) 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 (*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.