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