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 + const ErrCredentials + const ErrDuplicate + const ErrExpired + const ErrFailed + const ErrInternal + const ErrInvalidResponse + const ErrMalformed + const ErrNotFound + const ErrPermissionDenied + const ErrPolicy + const ErrRedirected + const ErrTopicNotFound + const ErrUnsupported + const ErrUserNotFound + const NullValue + const TimeFormatRFC3339 + const UploadCompleted + const UploadDeleted + const UploadFailed + const UploadStarted + func ChnToGrp(chn string) string + func FlattenDoubleSlice(data [][]string) []string + func GrpToChn(grp string) string + func IsChannel(name string) bool + func P2PNameForUser(uid Uid, p2p string) (string, error) + func TimeNow() time.Time + type AccessMode uint + const ModeApprove + const ModeBitmask + const ModeCAdmin + const ModeCAuth + const ModeCChnReader + const ModeCChnWriter + const ModeCFull + const ModeCP2P + const ModeCPublic + const ModeCReadOnly + const ModeCSelf + const ModeCSharer + const ModeCSys + const ModeDelete + const ModeInvalid + const ModeJoin + const ModeNone + const ModeOwner + const ModePres + const ModeRead + const ModeShare + const ModeUnset + const ModeWrite + func ParseAcs(b []byte) (AccessMode, error) + func (grant AccessMode) BetterEqual(want AccessMode) bool + func (grant AccessMode) BetterThan(want AccessMode) bool + func (m *AccessMode) ApplyDelta(delta string) error + func (m *AccessMode) ApplyMutation(mutation string) error + func (m *AccessMode) Scan(val interface{}) error + func (m *AccessMode) UnmarshalJSON(b []byte) error + func (m *AccessMode) UnmarshalText(b []byte) error + func (m AccessMode) IsAdmin() bool + func (m AccessMode) IsApprover() bool + func (m AccessMode) IsDefined() bool + func (m AccessMode) IsDeleter() bool + func (m AccessMode) IsInvalid() bool + func (m AccessMode) IsJoiner() bool + func (m AccessMode) IsOwner() bool + func (m AccessMode) IsPresencer() bool + func (m AccessMode) IsReader() bool + func (m AccessMode) IsSharer() bool + func (m AccessMode) IsWriter() bool + func (m AccessMode) IsZero() bool + func (m AccessMode) MarshalJSON() ([]byte, error) + func (m AccessMode) MarshalText() ([]byte, error) + func (m AccessMode) String() string + func (m AccessMode) Value() (driver.Value, error) + func (o AccessMode) Delta(n AccessMode) string + type Contact struct + Access DefaultAccess + Id string + LastSeen time.Time + MatchOn []string + Public interface{} + type Credential struct + Done bool + Method string + Resp string + Retries int + User string + Value string + type DefaultAccess struct + Anon AccessMode + Auth AccessMode + func (da *DefaultAccess) Scan(val interface{}) error + func (da DefaultAccess) Value() (driver.Value, error) + type DelMessage struct + DelId int + DeletedFor string + SeqIdRanges []Range + Topic string + type DeviceDef struct + DeviceId string + Lang string + LastSeen time.Time + Platform string + type FileDef struct + Location string + MimeType string + Size int64 + Status int + User string + type Friendcontact struct + FirendID string + User string + type LastSeenUA struct + UserAgent string + When time.Time + type Message struct + Content interface{} + DelId int + DeletedAt *time.Time + DeletedFor []SoftDelete + From string + Head MessageHeaders + SeqId int + Topic string + type MessageHeaders map[string]interface + func (mh *MessageHeaders) Scan(val interface{}) error + func (mh MessageHeaders) Value() (driver.Value, error) + type ObjHeader struct + CreatedAt time.Time + Id string + UpdatedAt time.Time + func (h *ObjHeader) InitTimes() + func (h *ObjHeader) MergeTimes(h2 *ObjHeader) + func (h *ObjHeader) SetUid(uid Uid) + func (h *ObjHeader) Uid() Uid + type ObjState int + const StateDeleted + const StateOK + const StateSuspended + const StateUndefined + func NewObjState(in string) (ObjState, error) + func (os *ObjState) Scan(val interface{}) error + func (os *ObjState) UnmarshalJSON(b []byte) error + func (os ObjState) MarshalJSON() ([]byte, error) + func (os ObjState) String() string + func (os ObjState) Value() (driver.Value, error) + type QueryOpt struct + Before int + IfModifiedSince *time.Time + Limit int + Since int + Topic string + User Uid + type Range struct + Hi int + Low int + type RangeSorter []Range + func (rs RangeSorter) Len() int + func (rs RangeSorter) Less(i, j int) bool + func (rs RangeSorter) Normalize() RangeSorter + func (rs RangeSorter) Swap(i, j int) + type SoftDelete struct + DelId int + User string + type StoreError string + func (s StoreError) Error() string + type StringSlice []string + func (ss *StringSlice) Scan(val interface{}) error + func (ss StringSlice) Value() (driver.Value, error) + type Subscription struct + DelId int + DeletedAt *time.Time + ModeGiven AccessMode + ModeWant AccessMode + Private interface{} + ReadSeqId int + RecvSeqId int + Topic string + User string + func (s *Subscription) GetDefaultAccess() *DefaultAccess + func (s *Subscription) GetLastSeen() *time.Time + func (s *Subscription) GetPublic() interface{} + func (s *Subscription) GetSeqId() int + func (s *Subscription) GetState() ObjState + func (s *Subscription) GetTouchedAt() time.Time + func (s *Subscription) GetTrusted() interface{} + func (s *Subscription) GetUserAgent() string + func (s *Subscription) GetWith() string + func (s *Subscription) LastModified() time.Time + func (s *Subscription) SetDefaultAccess(auth, anon AccessMode) + func (s *Subscription) SetLastSeenAndUA(when *time.Time, ua string) + func (s *Subscription) SetPublic(pub interface{}) + func (s *Subscription) SetSeqId(id int) + func (s *Subscription) SetState(state ObjState) + func (s *Subscription) SetTouchedAt(touchedAt time.Time) + func (s *Subscription) SetTrusted(tstd interface{}) + func (s *Subscription) SetWith(with string) + type Topic struct + Access DefaultAccess + DelId int + Owner string + Public interface{} + SeqId int + State ObjState + StateAt *time.Time + Tags StringSlice + TouchedAt time.Time + Trusted interface{} + UseBt bool + func (t *Topic) GetAccess(uid Uid) (mode AccessMode) + func (t *Topic) GetPrivate(uid Uid) (private interface{}) + func (t *Topic) GiveAccess(uid Uid, want, given AccessMode) + func (t *Topic) SetPrivate(uid Uid, private interface{}) + type TopicCat int + const TopicCatFnd + const TopicCatGrp + const TopicCatMe + const TopicCatP2P + const TopicCatSys + func GetTopicCat(name string) TopicCat + type Uid uint64 + const ZeroUid + func ParseP2P(p2p string) (uid1, uid2 Uid, err error) + func ParseUid(s string) Uid + func ParseUid32(s string) Uid + func ParseUserId(s string) Uid + func (uid *Uid) MarshalJSON() ([]byte, error) + func (uid *Uid) MarshalText() ([]byte, error) + func (uid *Uid) UnmarshalBinary(b []byte) error + func (uid *Uid) UnmarshalJSON(b []byte) error + func (uid *Uid) UnmarshalText(src []byte) error + func (uid Uid) Compare(u2 Uid) int + func (uid Uid) FndName() string + func (uid Uid) IsZero() bool + func (uid Uid) MarshalBinary() ([]byte, error) + func (uid Uid) P2PName(u2 Uid) string + func (uid Uid) PrefixId(prefix string) string + func (uid Uid) String() string + func (uid Uid) String32() string + func (uid Uid) UserId() string + type UidGenerator struct + func (ug *UidGenerator) DecodeUid(uid Uid) int64 + func (ug *UidGenerator) EncodeInt64(val int64) Uid + func (ug *UidGenerator) Get() Uid + func (ug *UidGenerator) GetStr() string + func (ug *UidGenerator) Init(workerID uint, key []byte) error + type UidSlice []Uid + func (us *UidSlice) Add(uid Uid) bool + func (us *UidSlice) Rem(uid Uid) bool + func (us UidSlice) Contains(uid Uid) bool + type User struct + Access DefaultAccess + DeviceArray []*DeviceDef + Devices map[string]*DeviceDef + LastSeen *time.Time + Public interface{} + State ObjState + StateAt *time.Time + Tags StringSlice + Trusted interface{} + UserAgent string