Versions in this module Expand all Collapse all v0 v0.20.5 Dec 19, 2022 v0.20.4 Dec 19, 2022 Changes in this version + func DecodeUid(uid types.Uid) int64 + func EncodeUid(id int64) types.Uid + func GetNewUUid() string + func InitAuthLogicalNames(config json.RawMessage) error + func RegisterAdapter(a adapter.Adapter) + func RegisterAuthScheme(name string, handler auth.AuthHandler) + func RegisterMediaHandler(name string, mh media.Handler) + func RegisterValidator(name string, v validate.Validator) + type DevicePersistenceInterface interface + Delete func(uid types.Uid, deviceID string) error + GetAll func(uid ...types.Uid) (map[types.Uid][]types.DeviceDef, int, error) + Update func(uid types.Uid, oldDeviceID string, dev *types.DeviceDef) error + var Devices DevicePersistenceInterface + type FilePersistenceInterface interface + DeleteUnused func(olderThan time.Time, limit int) error + FinishUpload func(fd *types.FileDef, success bool, size int64) (*types.FileDef, error) + Get func(fid string) (*types.FileDef, error) + LinkAttachments func(topic string, msgId types.Uid, attachments []string) error + StartUpload func(fd *types.FileDef) error + var Files FilePersistenceInterface + type FriendsPersistenceInterface interface + Add func(uid *types.Friendcontact) error + Delete func(uid types.Uid) error + Get func(uid types.Uid) error + var Friends FriendsPersistenceInterface + type MessagesPersistenceInterface interface + DeleteList func(topic string, delID int, forUser types.Uid, ranges []types.Range) error + GetAll func(topic string, forUser types.Uid, opt *types.QueryOpt) ([]types.Message, error) + GetDeleted func(topic string, forUser types.Uid, opt *types.QueryOpt) ([]types.Range, int, error) + Save func(msg *types.Message, attachmentURLs []string, readBySender bool) error + var Messages MessagesPersistenceInterface + type PersistentStorageInterface interface + Close func() error + DbStats func() func() interface{} + GetAdapter func() adapter.Adapter + GetAdapterName func() string + GetAdapterVersion func() int + GetAuthHandler func(name string) auth.AuthHandler + GetAuthNames func() []string + GetDbVersion func() int + GetLogicalAuthHandler func(name string) auth.AuthHandler + GetMediaHandler func() media.Handler + GetUid func() types.Uid + GetUidString func() string + GetValidator func(name string) validate.Validator + InitDb func(jsonconf json.RawMessage, reset bool) error + IsOpen func() bool + Open func(workerId int, jsonconf json.RawMessage) error + UpgradeDb func(jsonconf json.RawMessage) error + UseMediaHandler func(name, config string) error + var Store PersistentStorageInterface + type SubsPersistenceInterface interface + Create func(subs ...*types.Subscription) error + Delete func(topic string, user types.Uid) error + Get func(topic string, user types.Uid, keepDeleted bool) (*types.Subscription, error) + Update func(topic string, user types.Uid, update map[string]interface{}) error + var Subs SubsPersistenceInterface + type TopicsPersistenceInterface interface + Create func(topic *types.Topic, owner types.Uid, private interface{}) error + CreateP2P func(initiator, invited *types.Subscription) error + Delete func(topic string, isChan, hard bool) error + Get func(topic string) (*types.Topic, error) + GetSubs func(topic string, opts *types.QueryOpt) ([]types.Subscription, error) + GetSubsAny func(topic string, opts *types.QueryOpt) ([]types.Subscription, error) + GetUsers func(topic string, opts *types.QueryOpt) ([]types.Subscription, error) + GetUsersAny func(topic string, opts *types.QueryOpt) ([]types.Subscription, error) + OwnerChange func(topic string, newOwner types.Uid) error + Update func(topic string, update map[string]interface{}) error + var Topics TopicsPersistenceInterface + type UsersPersistenceInterface interface + AddAuthRecord func(uid types.Uid, authLvl auth.Level, scheme, unique string, secret []byte, ...) error + ConfirmCred func(id types.Uid, method string) error + Create func(user *types.User, private interface{}) (*types.User, error) + DelAuthRecords func(uid types.Uid, scheme string) error + DelCred func(id types.Uid, method, value string) error + Delete func(id types.Uid, hard bool) error + FailCred func(id types.Uid, method string) error + FindSubs func(id types.Uid, required [][]string, optional []string) ([]types.Subscription, error) + Get func(uid types.Uid) (*types.User, error) + GetActiveCred func(id types.Uid, method string) (*types.Credential, error) + GetAll func(uid ...types.Uid) ([]types.User, error) + GetAllCreds func(id types.Uid, method string, validatedOnly bool) ([]types.Credential, error) + GetAuthRecord func(user types.Uid, scheme string) (string, auth.Level, []byte, time.Time, error) + GetAuthUniqueRecord func(scheme, unique string) (types.Uid, auth.Level, []byte, time.Time, error) + GetByCred func(method, value string) (types.Uid, error) + GetChannels func(id types.Uid) ([]string, error) + GetOwnTopics func(id types.Uid) ([]string, error) + GetSubs func(id types.Uid) ([]types.Subscription, error) + GetTopics func(id types.Uid, opts *types.QueryOpt) ([]types.Subscription, error) + GetTopicsAny func(id types.Uid, opts *types.QueryOpt) ([]types.Subscription, error) + GetUnreadCount func(ids ...types.Uid) (map[types.Uid]int, error) + Update func(uid types.Uid, update map[string]interface{}) error + UpdateAuthRecord func(uid types.Uid, authLvl auth.Level, scheme, unique string, secret []byte, ...) error + UpdateLastSeen func(uid types.Uid, userAgent string, when time.Time) error + UpdateState func(uid types.Uid, state types.ObjState) error + UpdateTags func(uid types.Uid, add, remove, reset []string) ([]string, error) + UpsertCred func(cred *types.Credential) (bool, error) + var Users UsersPersistenceInterface