subscriptions

package
v0.0.0-...-775694b Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GQL_CONNECTION_INIT  = "connection_init"  // Client -> Server
	GQL_CONNECTION_ACK   = "connection_ack"   // Server -> Client
	GQL_CONNECTION_ERROR = "connection_error" // Server -> Client

	GQL_CONNECTION_KEEP_ALIVE = "ka" // Server -> Client

	GQL_CONNECTION_TERMINATE = "connection_terminate" // Client -> Server
	GQL_START                = "start"                // Client -> Server
	GQL_DATA                 = "data"                 // Server -> Client
	GQL_ERROR                = "error"                // Server -> Client
	GQL_COMPLETE             = "complete"             // Server -> Client
	GQL_STOP                 = "stop"                 // Client -> Server
)

Variables

This section is empty.

Functions

func Listen

func Listen(schema *graphql.Schema, channel *SubscriptionChannel)

Types

type ConnectionContext

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

type Handler

type Handler struct {
	Schema  *graphql.Schema
	Channel *SubscriptionChannel
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type OperationMessage

type OperationMessage struct {
	Payload       interface{} `json:"payload"`
	ID            string      `json:"id"`
	OperationType string      `json:"type"`
}

type OperationQuery

type OperationQuery struct {
	Payload       QueryParams `json:"payload"`
	ID            string      `json:"id"`
	OperationType string      `json:"type"`
}

type QueryParams

type QueryParams struct {
	Query         string                 `json:"query"`
	OperationName string                 `json:"operationName"`
	Variables     map[string]interface{} `json:"variables"`
}

type SubscriptionChannel

type SubscriptionChannel chan SubscriptionPayload

type SubscriptionPayload

type SubscriptionPayload struct {
	Name    string
	Payload interface{}
}

Jump to

Keyboard shortcuts

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