Documentation
¶
Overview ¶
graphql websocket http handler implementation
Index ¶
- func MakeAST(query string, schema *graphql.Schema) (*ast.Document, *graphql.Result)
- type Connection
- type Event
- type EventConnectionInit
- type EventConnectionReadClosed
- type EventConnectionTerminate
- type EventConnectionTimerClosed
- type EventConnectionWriteClosed
- type EventOperationComplete
- type EventOperationStart
- type EventOperationStop
- type Server
- type Subscription
- type TickCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection struct {
Server *Server
Subscriptions map[interface{}]*Subscription
Context mutcontext.MutableContext
Outgoing chan *proto.Message
Events chan Event
TickCloser *TickCloser
Stopcounter int32
}
base Connection state
func (*Connection) ReadLoop ¶
func (conn *Connection) ReadLoop(ws *websocket.Conn)
reading bytes from websocket to messages, posting events
func (*Connection) WriteLoop ¶
func (conn *Connection) WriteLoop(ws *websocket.Conn)
writes messages to websocket
type EventConnectionInit ¶
type EventConnectionInit struct {
Parameters interface{}
}
posted when Connection negotiation commences
type EventConnectionReadClosed ¶
type EventConnectionReadClosed struct {
}
posted when Connection read was closed
type EventConnectionTerminate ¶
type EventConnectionTerminate struct {
}
posted when Connection termination requested
type EventConnectionTimerClosed ¶
type EventConnectionTimerClosed struct {
}
posted when Connection timer was closed
type EventConnectionWriteClosed ¶
type EventConnectionWriteClosed struct {
}
posted when Connection write was closed
type EventOperationComplete ¶
type EventOperationComplete struct {
Id interface{}
}
posted when operation completed
type EventOperationStart ¶
type EventOperationStart struct {
Id interface{}
Payload *proto.PayloadOperation
}
posted when new operation requested
type EventOperationStop ¶
type EventOperationStop struct {
Id interface{}
}
posted when operation interruption requested
type Server ¶
type Server struct {
Upgrader *websocket.Upgrader
Schema *graphql.Schema
OnConnect common.FuncConnectCallback
OnOperation common.FuncOperationCallback
OnOperationDone common.FuncOperationDoneCallback
OnDisconnect common.FuncDisconnectCallback
OnPlainInit common.FuncPlainInit
OnPlainFail common.FuncPlainFail
IgnorePlainHttp bool
KeepAlive time.Duration
}
the Server itself
func (*Server) ServeHTTP ¶
func (server *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
http.Handler entrypoint
func (*Server) ServePlainHTTP ¶
func (server *Server) ServePlainHTTP(ctx mutcontext.MutableContext, w http.ResponseWriter, r *http.Request)
serve plain http request
func (*Server) ServeWebsocketHTTP ¶
func (server *Server) ServeWebsocketHTTP(ctx mutcontext.MutableContext, w http.ResponseWriter, r *http.Request)
serve websocket http request
type Subscription ¶
type Subscription struct {
Id interface{}
Payload *proto.PayloadOperation
Context mutcontext.MutableContext
}
base operation/Subscription state
type TickCloser ¶
ticker that also closes on stop
Click to show internal directories.
Click to hide internal directories.