Documentation ¶
Overview ¶
Package wstransport implements common gqlgen WebSocket transports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Negotiator ¶
type Negotiator struct { // Default is used when a client does not request any specific protocol. // // Default can be nil. Default gqlgenws.Protocol // Protocols contains all supported protocols using their name as the key. Protocols map[string]gqlgenws.Protocol // AcceptOptions defines options used during the WebSocket handshake. AcceptOptions websocket.AcceptOptions }
Negotiator is a gqlgen transport that accepts WebSocket connections.
Negotiator negotiates a protocol with the client based on its registered protocols then delegates connection handling to the protocol.
Negotiator returns an error to the client if no acceptable transport is found.
func NewNegotiator ¶
func NewNegotiator(def gqlgenws.Protocol, protocols ...gqlgenws.Protocol) *Negotiator
NewNegotiator creates a Negotiator with the provided default protocol and any extra protocol supplied.
func (*Negotiator) Do ¶
func (n *Negotiator) Do(w http.ResponseWriter, r *http.Request, exec graphql.GraphExecutor)
Click to show internal directories.
Click to hide internal directories.