Documentation ¶
Index ¶
- type Config
- type Storage
- func (b *Storage) Close() error
- func (b *Storage) CountOfflineMessages(username string) (int, error)
- func (b *Storage) DeleteBlockListItems(items []model.BlockListItem) error
- func (b *Storage) DeleteOfflineMessages(username string) error
- func (b *Storage) DeleteRosterItem(user, contact string) (rostermodel.Version, error)
- func (b *Storage) DeleteRosterNotification(contact, jid string) error
- func (b *Storage) DeleteUser(username string) error
- func (b *Storage) FetchBlockListItems(username string) ([]model.BlockListItem, error)
- func (b *Storage) FetchOfflineMessages(username string) ([]*xmpp.Message, error)
- func (b *Storage) FetchPrivateXML(namespace string, username string) ([]xmpp.XElement, error)
- func (b *Storage) FetchRosterItem(user, contact string) (*rostermodel.Item, error)
- func (b *Storage) FetchRosterItems(user string) ([]rostermodel.Item, rostermodel.Version, error)
- func (b *Storage) FetchRosterNotification(contact string, jid string) (*rostermodel.Notification, error)
- func (b *Storage) FetchRosterNotifications(contact string) ([]rostermodel.Notification, error)
- func (b *Storage) FetchUser(username string) (*model.User, error)
- func (b *Storage) FetchVCard(username string) (xmpp.XElement, error)
- func (b *Storage) InsertBlockListItems(items []model.BlockListItem) error
- func (b *Storage) InsertOfflineMessage(message *xmpp.Message, username string) error
- func (b *Storage) InsertOrUpdatePrivateXML(privateXML []xmpp.XElement, namespace string, username string) error
- func (b *Storage) InsertOrUpdateRosterItem(ri *rostermodel.Item) (rostermodel.Version, error)
- func (b *Storage) InsertOrUpdateRosterNotification(rn *rostermodel.Notification) error
- func (b *Storage) InsertOrUpdateUser(user *model.User) error
- func (b *Storage) InsertOrUpdateVCard(vCard xmpp.XElement, username string) error
- func (b *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 {
DataDir string `yaml:"data_dir"`
}
Config represents BadgerDB storage configuration.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage represents a BadgerDB storage sub system.
func (*Storage) CountOfflineMessages ¶
CountOfflineMessages returns current length of user's offline queue.
func (*Storage) DeleteBlockListItems ¶
func (b *Storage) DeleteBlockListItems(items []model.BlockListItem) error
DeleteBlockListItems deletes a set of block list item entities from storage.
func (*Storage) DeleteOfflineMessages ¶
DeleteOfflineMessages clears a user offline queue.
func (*Storage) DeleteRosterItem ¶
func (b *Storage) DeleteRosterItem(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) FetchBlockListItems ¶
func (b *Storage) FetchBlockListItems(username string) ([]model.BlockListItem, error)
FetchBlockListItems retrieves from storage all block list item entities associated to a given user.
func (*Storage) FetchOfflineMessages ¶
FetchOfflineMessages retrieves from storage current user offline queue.
func (*Storage) FetchPrivateXML ¶
FetchPrivateXML retrieves from storage a private element.
func (*Storage) FetchRosterItem ¶
func (b *Storage) FetchRosterItem(user, contact string) (*rostermodel.Item, error)
FetchRosterItem retrieves from storage a roster item entity.
func (*Storage) FetchRosterItems ¶
func (b *Storage) FetchRosterItems(user string) ([]rostermodel.Item, rostermodel.Version, error)
FetchRosterItems retrieves from storage all roster item entities associated to a given user.
func (*Storage) FetchRosterNotification ¶ added in v0.3.0
func (b *Storage) FetchRosterNotification(contact string, jid string) (*rostermodel.Notification, error)
FetchRosterNotification retrieves from storage a roster notification entity.
func (*Storage) FetchRosterNotifications ¶
func (b *Storage) FetchRosterNotifications(contact string) ([]rostermodel.Notification, error)
FetchRosterNotifications retrieves from storage all roster notifications associated to a given user.
func (*Storage) FetchVCard ¶
FetchVCard retrieves from storage a vCard element associated to a given user.
func (*Storage) InsertBlockListItems ¶
func (b *Storage) InsertBlockListItems(items []model.BlockListItem) error
InsertBlockListItems inserts a set of block list item entities into storage, only in case they haven't been previously inserted.
func (*Storage) InsertOfflineMessage ¶
InsertOfflineMessage inserts a new message element into user's offline queue.
func (*Storage) InsertOrUpdatePrivateXML ¶
func (b *Storage) InsertOrUpdatePrivateXML(privateXML []xmpp.XElement, namespace string, username string) error
InsertOrUpdatePrivateXML inserts a new private element into storage, or updates it in case it's been previously inserted.
func (*Storage) InsertOrUpdateRosterItem ¶
func (b *Storage) InsertOrUpdateRosterItem(ri *rostermodel.Item) (rostermodel.Version, error)
InsertOrUpdateRosterItem inserts a new roster item entity into storage, or updates it in case it's been previously inserted.
func (*Storage) InsertOrUpdateRosterNotification ¶
func (b *Storage) InsertOrUpdateRosterNotification(rn *rostermodel.Notification) error
InsertOrUpdateRosterNotification inserts a new roster notification entity into storage, or updates it in case it's been previously inserted.
func (*Storage) InsertOrUpdateUser ¶
InsertOrUpdateUser inserts a new user entity into storage, or updates it in case it's been previously inserted.
func (*Storage) InsertOrUpdateVCard ¶
InsertOrUpdateVCard inserts a new vCard element into storage, or updates it in case it's been previously inserted.