package
0.23.0
Repository: https://github.com/tinode/chat.git
Documentation: pkg.go.dev

# Packages

Package auth provides interfaces and types required for implementing an authenticaor.
Package concurrency is a very simple implementation of a mutex with channels.
Package adapter contains the interfaces to be implemented by the database adapter.
Package drafty contains utilities for conversion from Drafty to plain text.
Package logs exposes info, warning and error loggers.
Package media defines an interface which must be implemented by media upload/download handlers.
Package push contains interfaces to be implemented by push notification plugins.
Package ringhash implementats a consistent ring hash: https://en.wikipedia.org/wiki/Consistent_hashing.
Package store provides methods for registering and accessing database adapters.
Package validate defines an interface which must be implmented by credential validators.

# Functions

ErrAlreadyAuthenticated invalid attempt to authenticate an already authenticated session Switching users is not supported (409).
ErrAlreadyExists the object already exists (409).
ErrAPIKeyRequired valid API key is required (403).
ErrAttachFirst must attach to topic first in response to a client message (409).
ErrAuthFailed authentication failed with explicit server and incoming request timestamps (401).
ErrAuthRequired authentication required - user must authenticate first (401).
ErrAuthRequiredReply authentication required - user must authenticate first in response to a client request (401).
ErrAuthUnknownScheme authentication scheme is unrecognized or invalid (401).
ErrCallBusyExplicitTs indicates a "busy" reply to a video call request (486).
ErrCallBusyReply indicates a "busy" reply in response to a video call request (486).
ErrClusterUnreachable in-cluster communication has failed error with explicit server and incoming request timestamps (502).
ErrClusterUnreachableReply in-cluster communication has failed error as response to a client request (502).
ErrCommandOutOfSequence invalid sequence of comments, i.e.
ErrDuplicateCredential attempt to create a duplicate credential with explicit server and incoming request timestamps (409).
ErrGone topic deleted or user banned (410).
ErrInvalidResponse indicates that the client's response in invalid with explicit server and incoming request timestamps (406).
ErrLocked operation rejected because the topic is being deleted (503).
ErrLockedExplicitTs operation rejected because the topic is being deleted with explicit server and incoming request timestamps (503).
ErrLockedReply operation rejected because the topic is being deleted in response to a client request (503).
ErrMalformed request malformed (400).
ErrMalformedExplicitTs request malformed with explicit server and incoming request timestamps (400).
ErrMalformedReply request malformed in response to a client request (400).
ErrNotFound is an error for missing objects other than user or topic (404).
ErrNotFoundExplicitTs is an error for missing objects other than user or topic with explicit server and incoming request timestamps (404).
ErrNotFoundReply is an error for missing objects other than user or topic with explicit server and incoming request timestamps in response to a client request (404).
ErrNotImplemented feature not implemented with explicit server and incoming request timestamps (501).
ErrNotImplementedReply feature not implemented error in response to a client request (501).
ErrOperationNotAllowed a valid operation is not permitted in this context (405).
ErrOperationNotAllowedExplicitTs a valid operation is not permitted in this context with explicit server and incoming request timestamps (405).
ErrOperationNotAllowedReply a valid operation is not permitted in this context with explicit server and incoming request timestamps (405).
ErrPermissionDenied user is authenticated but operation is not permitted (403).
ErrPermissionDeniedExplicitTs user is authenticated but operation is not permitted with explicit server and incoming request timestamps (403).
ErrPermissionDeniedReply user is authenticated but operation is not permitted with explicit server and incoming request timestamps in response to a client request (403).
ErrPolicy request violates a policy (e.g.
ErrPolicyExplicitTs request violates a policy (e.g.
ErrPolicyReply request violates a policy (e.g.
ErrServiceUnavailableExplicitTs server overloaded error with explicit server and incoming request timestamps (503).
ErrServiceUnavailableReply server overloaded error in response to a client request (503).
ErrSessionNotFound valid API key is required (403).
ErrTooLarge packet or request size exceeded the limit (413).
ErrTopicNotFound topic is not found with explicit server and incoming request timestamps (404).
ErrTopicNotFoundReply topic is not found with explicit server and incoming request timestamps in response to a client request (404).
ErrUnknown database or other server error (500).
ErrUnknownExplicitTs database or other server error with explicit server and incoming request timestamps (500).
ErrUnknownReply database or other server error in response to a client request (500).
ErrUserNotFound user is not found with explicit server and incoming request timestamps (404).
ErrUserNotFoundReply user is not found with explicit server and incoming request timestamps in response to a client request (404).
ErrVersionNotSupported invalid (too low) protocol version (505).
InfoAlreadySubscribed response means request to subscribe was ignored because user is already subscribed (304).
InfoAuthReset is sent in response to request to reset authentication when it was completed but login was not performed (301).
InfoChallenge requires user to respond to presented challenge before login can be completed (300).
InfoFound redirects to a new resource (307).
InfoNoAction response means request was ignored because the object was already in the desired state with explicit server and incoming request timestamps (304).
InfoNoActionReply response means request was ignored because the object was already in the desired state in response to a client request (304).
InfoNotJoined response means request to leave was ignored because user was not subscribed (304).
InfoNotModified response means update request was a noop (304).
InfoNotModifiedExplicitTs response means update request was a noop with explicit server and incoming request timestamps (304).
InfoNotModifiedReply response means update request was a noop in response to a client request (304).
InfoUseOther is a response to a subscription request redirecting client to another topic (303).
InfoUseOtherReply is a response to a subscription request redirecting client to another topic (303).
InfoValidateCredentials requires user to confirm credentials before going forward (300).
InfoValidateCredentialsExplicitTs requires user to confirm credentials before going forward with explicit server and incoming request timestamps (300).
NewSessionStore initializes a session store.
NoContentParams indicates request was processed but resulted in no content (204).
NoContentParamsReply indicates request was processed but resulted in no content in response to a client request (204).
NoErr indicates successful completion (200).
NoErrAccepted indicates request was accepted but not processed yet (202).
NoErrAcceptedExplicitTs indicates request was accepted but not processed yet with explicit server and incoming request timestamps (202).
NoErrCreated indicated successful creation of an object (201).
NoErrDeliveredParams means requested content has been delivered (208).
NoErrEvicted indicates that the user was disconnected from topic for no fault of the user (205).
NoErrExplicitTs indicates successful completion with explicit server and incoming request timestamps (200).
NoErrParams indicates successful completion with additional parameters (200).
NoErrParamsExplicitTs indicates successful completion with additional parameters and explicit server and incoming request timestamps (200).
NoErrParamsReply indicates successful completion with additional parameters and explicit server and incoming request timestamps (200).
NoErrReply indicates successful completion as a reply to a client message (200).
NoErrShutdown means user was disconnected from topic because system shutdown is in progress (205).
ParsePluginFilter parses filter config string.

# Constants

GRPC is a gRPC connection.
LPOLL represents a long polling connection.
MULTIPLEX is a multiplexing session reprsenting a connection from proxy topic to master.
NONE is undefined/not set.
PROXY is temporary session used as a proxy at master node.
Individual request types.
{pub}, {note}.
Used in video call proxy sessions for routing call events.
{sub}.
{leave}.
{meta set|get}.
Individual request types.
Individual request types.
StopDeleted terminated due to being deleted.
StopNone no reason given/default.
StopRehashing terminated due to cluster rehashing (moved to a different node).
StopShutdown terminated due to system shutdown.
WEBSOCK represents websocket connection.

# Structs

ClientComMessage is a wrapper for client messages.
Cluster is the representation of the cluster.
ClusterHealth is content of a leader's health check of a follower node.
ClusterNode is a client's connection to another node.
ClusterPing is used to detect node restarts.
ClusterReq is either a Proxy to Master or Topic Proxy to Topic Master or intra-cluster routing request message.
ClusterResp is a Master to Proxy response message.
ClusterRoute is intra-cluster routing request message.
ClusterSess is a basic info on a remote session where the message was created.
ClusterSessUpdate represents a request to update a session.
ClusterVote is a vote request and a response in leader election.
ClusterVoteRequest is a request from a leader candidate to a node to vote for the candidate.
ClusterVoteResponse is a vote from a node.
Hub is the core structure which holds topics.
MsgAccessMode is a definition of access mode.
MsgClientAcc is an {acc} message for creating or updating a user account.
MsgClientDel delete messages or topic {del}.
MsgClientExtra is not a stand-alone message but extra data which augments the main payload.
MsgClientGet is a query of topic state {get}.
MsgClientHi is a handshake {hi} message.
MsgClientLeave is an unsubscribe {leave} request message.
MsgClientLogin is a login {login} message.
MsgClientNote is a client-generated notification for topic subscribers {note}.
MsgClientPub is client's request to publish data to topic subscribers {pub}.
MsgClientSet is an update of topic state {set}.
MsgClientSub is a subscription request {sub} message.
MsgCredClient is an account credential such as email or phone number.
MsgCredServer is an account credential such as email or phone number.
MsgDefaultAcsMode is a topic default access mode.
MsgDelRange is either an individual ID (HiId=0) or a randge of deleted IDs, low end inclusive (closed), high-end exclusive (open): [LowId .
MsgDelValues describes request to delete messages.
MsgGetOpts defines Get query parameters.
MsgGetQuery is a topic metadata or data query.
MsgLastSeenInfo contains info on user's appearance online - when & user agent.
MsgServerCtrl is a server control message {ctrl}.
MsgServerData is a server {data} message.
MsgServerInfo is the server-side copy of MsgClientNote with From and optionally Src added (non-authoritative).
MsgServerMeta is a topic metadata {meta} update.
MsgServerPres is presence notification {pres} (authoritative update).
MsgSetDesc is a C2S in set.what == "desc", acc, sub message.
MsgSetQuery is an update to topic or user metadata: description, subscriptions, tags, credentials.
MsgSetSub is a payload in set.sub request to update current subscription or invite another user, {sub.what} == "sub".
MsgTopicDesc is a topic description, S2C in Meta message.
MsgTopicSub is topic subscription details, sent in Meta message.
Plugin defines client-side parameters of a gRPC plugin.
PluginFilter is a enum which defines filtering types.
ServerComMessage is a wrapper for server-side messages.
Session represents a single WS connection or a long polling session.
SessionStore holds live sessions.
Subscription is a mapper of sessions to topics.
Topic is an isolated communication channel.
UserCacheReq contains data which mutates one or more user cache entries.

# Type aliases

ProxyReqType is the type of proxy requests.
SessionProto is the type of the wire transport.