# Functions
GetTopicCat given topic name returns topic category.
ParseP2P extracts uids from the name of a p2p topic.
ParseUid parses string NOT prefixed with anything.
ParseUid32 parses base32-encoded string into Uid.
ParseUserId parses user ID of the form "usrXXXXXX".
TimeNow returns current wall time in UTC rounded to milliseconds.
# Constants
ErrCredentials means credentials like email or captcha must be validated.
ErrDuplicate means duplicate credential, i.e.
ErrExpired means the secret has expired.
ErrFailed means authentication failed (wrong login or password, etc).
ErrInternal means DB or other internal failure.
ErrMalformed means the secret cannot be parsed or otherwise wrong.
ErrNotFound means the objevy was not found.
ErrPermissionDenied means the operation is not permitted.
ErrPolicy means policy violation, e.g.
ErrUnsupported means an operation is not supported.
user can approve new members or evict existing members (A:0x10).
Admin: user who can modify access mode ("OA", hex: 0x90, dec: 144).
Owner's subscription to a generic topic ("JRWPASDO").
Default P2P access mode ("JRWPA").
Normal user's access to a topic ("JRWPS").
Read-only access to topic ("JR", 0x3).
User's subscription to 'me' and 'fnd' ("JP").
Sharer: flags which define user who can be notified of access mode changes ("OAS", dec: 176, hex: 0xB0).
user can hard-delete messages (D:0x40).
Invalid mode to indicate an error.
user can join, i.e.
No access, requests to gain access are processed normally (N).
user is the owner (O:0x80) - full access.
user can receive presence updates (P:8).
user can receive broadcasts ({data}, {info}) (R:2).
user can invite new members (S:0x20).
Non-zero value to indicate unknown or undefined mode (:0x100),.
user can Write, i.e.
TopicCatFnd is a value denoting 'fnd' topic.
TopicCatGrp is a a value denoting group topic.
TopicCatMe is a value denoting 'me' topic.
TopicCatP2P is a a value denoting 'p2p topic.
UploadCompleted indicates that the upload has completed successfully.
UploadFailed indicates that the upload has failed.
UploadStarted indicates that the upload has started but not finished yet.
ZeroUid is a constant representing uninitialized Uid.
# Structs
Contact is a result of a search for connections.
Credential hold data needed to validate and check validity of a credential like email or phone.
DefaultAccess is a per-topic default access modes.
DelMessage is a log entry of a deleted message range.
DeviceDef is the data provided by connected device.
FileDef is a stored record of a file upload.
Message is a stored {data} message.
ObjHeader is the header shared by all stored objects.
QueryOpt is options of a query, [since, before] - both ends inclusive (closed).
Range is a range of message SeqIDs.
SoftDelete is a single DB record of soft-deletetion.
Subscription to a topic.
Topic stored in database.
UidGenerator holds snowflake and encryption paramenets.
User is a representation of a DB-stored user record.
# Type aliases
AccessMode is a definition of access mode bits.
MessageHeaders is needed to attach Scan() to.
RangeSorter is a helper type required by 'sort' package.
StoreError satisfies Error interface but allows constant values for direct comparison.
StringSlice is defined so Scanner and Valuer can be attached to it.
TopicCat is an enum of topic categories.
Uid is a database-specific record id, suitable to be used as a primary key.