Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SubscribeHandlerFunc ¶
type SubscribeHandlerFunc func( ctx context.Context, request *common.Request, wsController *WebsocketController, ) (subscription.Subscription, error)
SubscribeHandlerFunc is a function that contains endpoint handling logic for subscribes, fetches necessary resources
type WSHandler ¶
type WSHandler struct { *common.HttpHandler // contains filtered or unexported fields }
WSHandler is websocket handler implementing custom websocket handler function and allows easier handling of errors and responses as it wraps functionality for handling error and responses outside of endpoint handling.
func NewWSHandler ¶
type WebsocketController ¶
type WebsocketController struct { Api state_stream.API // the state_stream.API instance for managing event subscriptions EventFilterConfig state_stream.EventFilterConfig // the configuration for filtering events HeartbeatInterval uint64 // the interval to deliver heartbeat messages to client[IN BLOCKS] // contains filtered or unexported fields }
WebsocketController holds the necessary components and parameters for handling a WebSocket subscription. It manages the communication between the server and the WebSocket client for subscribing.
func (*WebsocketController) SetWebsocketConf ¶
func (wsController *WebsocketController) SetWebsocketConf() error
SetWebsocketConf used to set read and write deadlines for WebSocket connections and establishes a Pong handler to manage incoming Pong messages. These methods allow to specify a time limit for reading from or writing to a WebSocket connection. If the operation (reading or writing) takes longer than the specified deadline, the connection will be closed.