http

package
v0.0.0-...-2d960bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 12 Imported by: 2

Documentation

Overview

Package http handles GraphQL HTTP Requests including WebSocket Upgrades.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleWebsocket

func HandleWebsocket(done chan bool, errChan chan error, conn net.Conn, executorPool subscription.ExecutorPool, logger abstractlogger.Logger)

func NewGraphqlHTTPHandler

func NewGraphqlHTTPHandler(
	schema *graphql.Schema,
	engine *engine.ExecutionEngine,
	upgrader *ws.HTTPUpgrader,
	logger log.Logger,
	enableART bool,
) http.Handler

Types

type GraphQLHTTPRequestHandler

type GraphQLHTTPRequestHandler struct {
	// contains filtered or unexported fields
}

func (*GraphQLHTTPRequestHandler) ServeHTTP

type WebsocketSubscriptionClient

type WebsocketSubscriptionClient struct {
	// contains filtered or unexported fields
}

WebsocketSubscriptionClient is an actual implementation of the subscription client interface.

func NewWebsocketSubscriptionClient

func NewWebsocketSubscriptionClient(logger abstractlogger.Logger, clientConn net.Conn) *WebsocketSubscriptionClient

NewWebsocketSubscriptionClient will create a new websocket subscription client.

func (*WebsocketSubscriptionClient) Disconnect

func (w *WebsocketSubscriptionClient) Disconnect() error

Disconnect will close the websocket connection.

func (*WebsocketSubscriptionClient) IsConnected

func (w *WebsocketSubscriptionClient) IsConnected() bool

IsConnected will indicate if the websocket connection is still established.

func (*WebsocketSubscriptionClient) ReadFromClient

func (w *WebsocketSubscriptionClient) ReadFromClient() (message *subscription.Message, err error)

ReadFromClient will read a subscription message from the websocket client.

func (*WebsocketSubscriptionClient) WriteToClient

func (w *WebsocketSubscriptionClient) WriteToClient(message subscription.Message) error

WriteToClient will write a subscription message to the websocket client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL