Documentation ¶
Overview ¶
Package gss is a web server using GraphQL over WebSocket Protocol: https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md
See README.md for more info.
Index ¶
- func NewNotifyHandler(ch chan *RequestData) http.Handler
- func NewSubscribeFilter() *subscribeFilter
- type CanSendToUserFunc
- type ChannelSerializer
- type GraphQLContextKey
- type NotificationHandler
- type NotificationResponse
- type QueryArgsMap
- type RequestData
- type SubscribeFilter
- type SubscribeService
- func (s *SubscribeService) AddSubscription(conn graphqlws.Connection, sub *graphqlws.Subscription) []error
- func (s *SubscribeService) NewSubscriptionHandler(authCallback graphqlws.AuthenticateFunc) http.Handler
- func (s *SubscribeService) Publish(reqData *RequestData)
- func (s *SubscribeService) RemoveSubscription(conn graphqlws.Connection, sub *graphqlws.Subscription)
- func (s *SubscribeService) RemoveSubscriptions(conn graphqlws.Connection)
- func (s *SubscribeService) Subscriptions() graphqlws.Subscriptions
- type SubscriptionIDByConnectionID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNotifyHandler ¶
func NewNotifyHandler(ch chan *RequestData) http.Handler
func NewSubscribeFilter ¶
func NewSubscribeFilter() *subscribeFilter
Types ¶
type CanSendToUserFunc ¶
type CanSendToUserFunc func(conn *graphqlws.Connection, reqData *RequestData) bool
type ChannelSerializer ¶
type ChannelSerializer interface {
Serialize(field string, args QueryArgsMap) string
}
type GraphQLContextKey ¶
type GraphQLContextKey string
type NotificationHandler ¶
type NotificationHandler struct {
// contains filtered or unexported fields
}
func (*NotificationHandler) ServeHTTP ¶
func (h *NotificationHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
type NotificationResponse ¶
type QueryArgsMap ¶
type RequestData ¶
type RequestData struct { Users []string `json:"users"` Channel string `json:"channel"` Payload interface{} `json:"payload"` }
func NewRequestDataFromBytes ¶
func NewRequestDataFromBytes(b []byte) (*RequestData, error)
func (*RequestData) Validate ¶
func (d *RequestData) Validate() error
type SubscribeFilter ¶
type SubscribeFilter interface { RegisterConnectionIDFromDocument(connID string, subID string, doc *ast.Document, variables map[string]interface{}) RemoveSubscriptionIDFromConnectionID(connID, subID string) RemoveConnectionIDFromChannels(connID string) GetChannelRegisteredConnectionIDs(channel string) SubscriptionIDByConnectionID }
type SubscribeService ¶
type SubscribeService struct { graphqlws.SubscriptionManager Schema *graphql.Schema Pool graphqlws.SubscriptionManager Filter SubscribeFilter // contains filtered or unexported fields }
func NewSubscribeService ¶
func NewSubscribeService(schema *graphql.Schema, c CanSendToUserFunc) *SubscribeService
func (*SubscribeService) AddSubscription ¶
func (s *SubscribeService) AddSubscription(conn graphqlws.Connection, sub *graphqlws.Subscription) []error
func (*SubscribeService) NewSubscriptionHandler ¶
func (s *SubscribeService) NewSubscriptionHandler(authCallback graphqlws.AuthenticateFunc) http.Handler
func (*SubscribeService) Publish ¶
func (s *SubscribeService) Publish(reqData *RequestData)
func (*SubscribeService) RemoveSubscription ¶
func (s *SubscribeService) RemoveSubscription(conn graphqlws.Connection, sub *graphqlws.Subscription)
func (*SubscribeService) RemoveSubscriptions ¶
func (s *SubscribeService) RemoveSubscriptions(conn graphqlws.Connection)
func (*SubscribeService) Subscriptions ¶
func (s *SubscribeService) Subscriptions() graphqlws.Subscriptions
Source Files ¶
Click to show internal directories.
Click to hide internal directories.