package
0.0.0-20220908142214-d213672e65e0
Repository: https://github.com/bitquery/wsgraphql.git
Documentation: pkg.go.dev

# Functions

NewSubscriberAlreadyExistsError constructs new Error using subscriber id as part of the message.
WrapError wraps provided error into Error.

# Constants

EventCloseError standard websocket message type.
EventCloseNormal standard websocket message type.
EventInitializationTimeout indicates timeout occurring before client sending OperationConnectionInit.
EventInvalidMessage indicates invalid protocol message.
EventSubscriberAlreadyExists indicates subscribed operation ID already being in use (not yet terminated by either OperationComplete or OperationError).
EventTooManyInitializationRequests indicates receiving more than one OperationConnectionInit.
EventUnauthorized indicated attempt to subscribe to an operation before receiving OperationConnectionAck.
OperationComplete [GWS,GTWS] GWS: server response indicating previously initiated operation is complete GTWS: server response indicating previously initiated operation is complete GTWS: client request to stop previously initiated operation with OperationSubscribe.
OperationConnectionAck [GWS,GTWS] server response to successful OperationConnectionInit attempt.
OperationConnectionError [GWS] server response to unsuccessful OperationConnectionInit attempt.
OperationConnectionInit [GWS,GTWS] is set by the connecting client to initialize the websocket state with connection params (if any).
OperationData [GWS] server response to previously initiated operation with OperationStart may be multiple within same operation, specifically for subscriptions.
OperationError [GWS,GTWS] server response to previously initiated operation with OperationStart/OperationSubscribe.
OperationKeepAlive [GWS] server response sent periodically to maintain websocket connection open.
OperationNext [GTWS] server response to previously initiated operation with OperationSubscribe may be multiple within same operation, specifically for subscriptions.
OperationPing [GTWS] sever/client request for OperationPong response.
OperationPong [GTWS] sever/client response for OperationPing request can be sent at any time (without prior OperationPing) to maintain wesocket connection.
OperationStart [GWS] client request initiates new operation, each operation may have 0-N OperationData responses before being terminated by either OperationComplete or OperationError.
OperationStop [GWS] client request to stop previously initiated operation with OperationStart.
OperationSubscribe [GTWS] client request initiates new operation, each operation may have 0-N OperationNext responses before being terminated by either OperationComplete or OperationError.
OperationTerminate [GWS] client request to gracefully close the connection, equivalent to closing the websocket.
WebsocketSubprotocolGraphqlTransportWS websocket subprotocol exepected by graphql-ws implementations.
WebsocketSubprotocolGraphqlWS websocket subprotocol expected by subscriptions-transport-ws implementations.

# Variables

ErrUnknownProtocol indicates that unknown subscription protocol was requested.

# Structs

Data encapsulates both client and server json payload, combining json.RawMessage for decoding and arbitrary interface{} type for encoding.
MessageRaw encapsulates every message within apollows protocol in both directions.
PayloadDataRaw provides server-side response for previously started operation.
PayloadDataResponse provides client-side payload representation.
PayloadError client-side error representation.
PayloadErrorLocation error location in originating request.
PayloadOperation provides description for client-side operation initiation.

# Interfaces

Error providing MessageType to close websocket with.

# Type aliases

Message type-alias for (de-)serialization.
MessageType websocket message types / status codes used to indicate protocol-level events following closing the websocket.
Operation type is used to enumerate possible apollo message types.
PayloadData type-alias for serialization.
PayloadInit provides connection params.
Protocol websocket subprotocol defining server behavior.