Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIGatewayManagementClient ¶
type APIGatewayManagementClient interface {
PostToConnection(ctx context.Context, params *apigatewaymanagementapi.PostToConnectionInput, optFns ...func(*apigatewaymanagementapi.Options)) (*apigatewaymanagementapi.PostToConnectionOutput, error)
DeleteConnection(ctx context.Context, params *apigatewaymanagementapi.DeleteConnectionInput, optFns ...func(*apigatewaymanagementapi.Options)) (*apigatewaymanagementapi.DeleteConnectionOutput, error)
}
type AuthenticatedMessage ¶
AuthenticatedMessage is a message that includes the driver ID for auth verification
type ConnectionLookup ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(disconnectHandler, authHandler, pingHandler RouteHandler) *Handler
func (*Handler) Handle ¶
func (h *Handler) Handle(ctx context.Context, request events.APIGatewayWebsocketProxyRequest) (events.APIGatewayProxyResponse, error)
type Pusher ¶
type Pusher struct {
// contains filtered or unexported fields
}
func NewPusher ¶
func NewPusher(client APIGatewayManagementClient, connectionLookup ConnectionLookup) *Pusher
func (*Pusher) Broadcast ¶
func (p *Pusher) Broadcast(ctx context.Context, driverID int64, actionType string, payload any) error
Broadcast sends a message to all active connections for a given driver.
func (*Pusher) Disconnect ¶
Disconnect closes a WebSocket connection.
func (*Pusher) Push ¶
func (p *Pusher) Push(ctx context.Context, connectionID string, actionType string, payload any) (bool, error)
Push dispatches messages in a consistent format. When the connection is valid true, nil will be returned, but if the message could not be delivered due to the connection being disconnected false, nil will be returned.
type RouteHandler ¶
type RouteHandler interface {
HandleRequest(ctx context.Context, request events.APIGatewayWebsocketProxyRequest) (events.APIGatewayProxyResponse, error)
}
type RouteHandlerFunc ¶
type RouteHandlerFunc func(ctx context.Context, request events.APIGatewayWebsocketProxyRequest) (events.APIGatewayProxyResponse, error)
func (RouteHandlerFunc) HandleRequest ¶
func (r RouteHandlerFunc) HandleRequest(ctx context.Context, request events.APIGatewayWebsocketProxyRequest) (events.APIGatewayProxyResponse, error)
Click to show internal directories.
Click to hide internal directories.