package
0.0.0-20250208085904-1b1a66c1158a
Repository: https://github.com/breadchris/share.git
Documentation: pkg.go.dev
# Functions
NewAPIError - Creates a type labelled API error.
# Constants
CMD metadata type Client: Submit a command to be run by the leaps service.
CMDList metadata type Server: Send a newly connected client a list of available static commands that can be run through leaps.
CMDOutput metadata type Server: Send the result of a command to all clients connected to the leaps service.
Correction event type Server: Send correction of prior received transform from client.
Error event type Server: Send information regarding an API error.
GlobalMetadata event type Client: Send metadata to other users of leaps service Server: Send metadata from other user of leaps service.
Metadata event type Client: Send metadata to other users of document Server: Send metadata from other user of document.
Ping event type Client: Send intent to annoy the server.
Pong event type Server: Send confirm of annoyance.
Subscribe event type Client: Send intent to subscribe to a document Server: Send confirmation that document is now subscribed.
Transform event type Client: Send intent to transform server copy of document Server: Send intent to transform local copy of document.
Transforms event type Server: Send intent to transform local copy of document with multiple transforms.
Unsubscribe event type Client: Send intent to unsubscribe from a document Server: Send confirmation that document is now unsubscribed.
UserConnected metadata type Server: Send on client connect to leaps service to all other clients.
UserDisconnected metadata type Server: Send on client disconnect to leaps service to all other clients.
UserInfo metadata subtype Server: Send a newly connected client a list of existing clients and their subscriptions, as well the users own username and session id.
UserSubscribe metadata type Server: Send on client subscribe to document to all other clients.
UserUnsubscribe metadata type Server: Send on client unsubscribe to document to all other clients.
# Variables
Error type strings.
Error type strings.
Error type strings.
Error type strings.
Error type strings.
Error type strings.
Error type strings.
# Structs
APIError - Implementation of TypedError for the API.
Client contains data about a client session.
CMDData contains the id and the results from a command (if applicable).
CMDListMetadataMessage is a metadata body which carries a list of statically defined commands available to clients.
CMDMetadataMessage is a metadata body which carries the id and output from a command to all clients connected to the leaps service.
CorrectionMessage is an API body encompassing a correction to a submitted transform.
DocumentFull contains all data related to a document, including the current version of the content.
DocumentStripped contains fields for identifying docs but not carrying its contents.
ErrorMessage is an API body encompassing an API error.
GlobalMetadataMessage is an API body encompassing a global metadata message, and fields identifying the client source.
MetadataBody is a message body for typed metadata.
MetadataMessage is an API body encompassing a metadata message, fields identifying the document target, and fields identifying the client source.
SubscriptionMessage is an API body encompassing fields identifying a document that has been subscribed as well as its full contents.
TformCorrection contains fields used to correct a transform.
TransformMessage is an API body encompassing a transform and fields identifying the document target.
TransformsMessage is an API body encompassing a slice of transforms and fields identifying the document target.
UnsubscriptionMessage is an API body encompassing fields identifying a document that has been unsubscribed.
UserInfoMetadataMessage is a metadata body encompassing a map of connected session_id's and their document subscriptions.
UserSubscriptions contains user identifying information and a list of their active subscriptions (document IDs).
# Interfaces
TypedError - An error with a type string so that API clients can easily categorise the fault.