api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionCreated           = MessageType("SESSION_CREATED")
	SessionUpdated           = MessageType("SESSION_UPDATED")
	FacilitatorSessionLoaded = MessageType("FACILITATOR_SESSION_LOADED")
	SessionLoaded            = MessageType("SESSION_LOADED")
	ErrorEncountered         = MessageType("ERROR_ENCOUNTERED")
)

Variables

This section is empty.

Functions

func NewInternalServerError

func NewInternalServerError(ctx context.Context) events.APIGatewayProxyResponse

func NewPermissionDeniedResponse

func NewPermissionDeniedResponse(ctx context.Context) events.APIGatewayProxyResponse

func NewSuccessResponse

func NewSuccessResponse(ctx context.Context, result interface{}) events.APIGatewayProxyResponse

func NewValidationFailureResponse

func NewValidationFailureResponse(ctx context.Context, result ValidationError) events.APIGatewayProxyResponse

Types

type ConnectionPoster

type ConnectionPoster interface {
	PostToConnectionWithContext(ctx aws.Context, input *apigatewaymanagementapi.PostToConnectionInput, opts ...request.Option) (*apigatewaymanagementapi.PostToConnectionOutput, error)
}

type FieldValidationError

type FieldValidationError struct {
	Field string `json:"field"`
	Error string `json:"error"`
}

type Message

type Message struct {
	Type MessageType `json:"type"`
	Body interface{} `json:"body"`
}

type MessageDispatcher

type MessageDispatcher func(ctx context.Context, connectionID string, message Message) error

func NewMessageDispatcher

func NewMessageDispatcher(gateway ConnectionPoster) MessageDispatcher

type MessageType

type MessageType string

type Response

type Response struct {
	Result    interface{} `json:"result"`
	RequestID string      `json:"requestId"`
}

type ValidationError

type ValidationError struct {
	FieldErrors []FieldValidationError `json:"fieldErrors"`
	Errors      []string               `json:"errors"`
}

Jump to

Keyboard shortcuts

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