http

package
v0.0.0-...-5e166c9 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 12 Imported by: 0

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 deprecated

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

HandleWebsocket will handle a websocket connection.

Deprecated: This HandleWebsocket is deprecated. Use github.com/dchukmasov/graphql-go-tools/pkg/subscription/websocket instead.

func HandleWebsocketWithInitFunc deprecated

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

HandleWebsocketWithInitFunc will handle a websocket connection with the ability to provide an InitFunc.

Deprecated: This HandleWebsocketWithInitFunc is deprecated. Use github.com/dchukmasov/graphql-go-tools/pkg/subscription/websocket instead.

func NewGraphqlHTTPHandlerFunc

func NewGraphqlHTTPHandlerFunc(executionHandler *execution.Handler, logger log.Logger, upgrader *ws.HTTPUpgrader) http.Handler

Types

type GraphQLHTTPRequestHandler

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

func (*GraphQLHTTPRequestHandler) ServeHTTP

type WebsocketSubscriptionClient deprecated

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

WebsocketSubscriptionClient is an actual implementation of the subscription client interface.

Deprecated: This WebsocketSubscriptionClient is deprecated. Use github.com/dchukmasov/graphql-go-tools/pkg/subscription/websocket instead.

func NewWebsocketSubscriptionClient deprecated

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

NewWebsocketSubscriptionClient will create a new websocket subscription client.

Deprecated: This NewWebsocketSubscriptionClient is deprecated. Use github.com/dchukmasov/graphql-go-tools/pkg/subscription/websocket instead.

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 conenction 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