Documentation
¶
Index ¶
- Constants
- func DynamoDBStream(ctx context.Context, req events.DynamoDBEvent) error
- func Execute(operationID string, connectionID string, domainName string, stage string, ...)
- func HandleWS(ctx context.Context, req events.APIGatewayWebsocketProxyRequest) (events.APIGatewayProxyResponse, error)
- func Pub(key string, payload map[string]interface{}) error
- func SetManager(args *SetManagerArgs)
- func Sub(keys []string, ctx context.Context) (interface{}, error)
- type Connection
- type ConnectionManager
- type ContextKey
- type Event
- type EventManager
- type Local
- type Manager
- type Message
- type SetManagerArgs
- type Subscription
- type SubscriptionManager
- type SubscriptionResponse
- type WSlambdaContext
Constants ¶
View Source
const ( RouteKeyConnect string = "$connect" RouteKeyDisconnect string = "$disconnect" RouteKeyDefault string = "$default" )
View Source
const ( // client GraphQLSubStart string = "start" GraphQLSubStop string = "stop" GraphQLConnectionInit string = "connection_init" GraphQLConnectionTerminate string = "connection_terminate" // server GraphQLConnectionACK string = "connection_ack" GraphQLError string = "error" GraphQLData string = "data" GraphQLComplete string = "complete" )
Variables ¶
This section is empty.
Functions ¶
func DynamoDBStream ¶
func DynamoDBStream(ctx context.Context, req events.DynamoDBEvent) error
func HandleWS ¶
func HandleWS(ctx context.Context, req events.APIGatewayWebsocketProxyRequest) (events.APIGatewayProxyResponse, error)
func SetManager ¶
func SetManager(args *SetManagerArgs)
Types ¶
type Connection ¶
type Connection struct {
Id string `dynamodbav:"id"`
Domain string `dynamodbav:"domain"`
Stage string `dynamodbav:"stage"`
Context string `dynamodbav:"context"`
IsInitialized bool `dynamodbav:"isInitialized"`
CreatedAt *time.Time `dynamodbav:"createdAt"`
WebsocketConnectContext interface{} `dynamodbav:"websocketConnectContext"`
ConnectContext interface{} `dynamodbav:"connectContext"`
Ttl int64 `dynamodbav:"ttl"`
}
type ConnectionManager ¶
type EventManager ¶
type Manager ¶
type Manager struct {
Schema *graphql.Schema
Connection ConnectionManager
Subscription SubscriptionManager
Event EventManager
OnWebsocketConnect *func(*events.APIGatewayWebsocketProxyRequest) interface{}
OnConnect *func(*events.APIGatewayWebsocketProxyRequest) interface{}
OnDisconnect *func(*Connection)
}
var CurrentManager *Manager
type SetManagerArgs ¶
type SetManagerArgs struct {
Schema *graphql.Schema
Connection ConnectionManager
Subscription SubscriptionManager
Event EventManager
OnWebsocketConnect *func(*events.APIGatewayWebsocketProxyRequest) interface{}
OnConnect *func(*events.APIGatewayWebsocketProxyRequest) interface{}
OnDisconnect *func(*Connection)
}
type Subscription ¶
type Subscription struct {
Event string `dynamodbav:"event"`
ConnectionID string `dynamodbav:"connectionId"`
OperationID string `dynamodbav:"operationId"`
Query string `dynamodbav:"query"`
Variables map[string]interface{} `dynamodbav:"variables"`
OperationName string `dynamodbav:"operationName"`
Ttl int64 `dynamodbav:"ttl"`
}
type SubscriptionManager ¶
type SubscriptionManager interface {
Start(subscription *Subscription) error
Stop(connectionID string, operationID string) error
ListByEvents(eventKey string, from *string) (*SubscriptionResponse, error)
}
type SubscriptionResponse ¶
type SubscriptionResponse struct {
Items *[]Subscription
Next *string
}
Click to show internal directories.
Click to hide internal directories.