common

package
v0.0.0-...-3ae4f16 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(err error, statusCode int) (events.APIGatewayProxyResponse, error)

Types

type ApiGatewayManagementAPI

type ApiGatewayManagementAPI interface {
	PostToConnection(connectionID, body string) error
}

func NewApiGatewayManagementApi

func NewApiGatewayManagementApi(APIID, stage string) (ApiGatewayManagementAPI, error)

type ApiGatewayManagementAPIImpl

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

func (*ApiGatewayManagementAPIImpl) PostToConnection

func (a *ApiGatewayManagementAPIImpl) PostToConnection(connectionID, body string) error

type Client

type Client struct {
	ConnectionID string    `dynamo:"connectionId"`
	ClientID     string    `dynamo:"clientId"`
	Joined       time.Time `dynamo:"joined"`
}

type Connection

type Connection struct {
	ConnectionID string `dynamo:"connectionId"`
	RoomID       string `dynamo:"roomId"`
}

type DB

type DB interface {
	Table(name string) Table
	TxPut(items ...TableItem) error

	RoomsTable() Table
	ConnectionsTable() Table
}

func NewDB

func NewDB(sess *session.Session, config *aws.Config) DB

type DynamoDB

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

func (DynamoDB) ConnectionsTable

func (d DynamoDB) ConnectionsTable() Table

func (DynamoDB) RoomsTable

func (d DynamoDB) RoomsTable() Table

func (DynamoDB) Table

func (d DynamoDB) Table(name string) Table

func (*DynamoDB) TxPut

func (d *DynamoDB) TxPut(items ...TableItem) error

type DynamoTable

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

func (DynamoTable) Delete

func (t DynamoTable) Delete(column string, key interface{}) error

func (DynamoTable) FindOne

func (t DynamoTable) FindOne(column string, key, out interface{}) error

func (DynamoTable) Put

func (t DynamoTable) Put(item interface{}) error

type Room

type Room struct {
	RoomID  string    `dynamo:"roomId"`
	Clients []Client  `dynamo:"clients"`
	Created time.Time `dynamo:"created"`
}

type Table

type Table interface {
	FindOne(column string, key, out interface{}) error
	Put(row interface{}) error
	Delete(column string, key interface{}) error
}

type TableItem

type TableItem struct {
	Table Table
	Item  interface{}
}

Jump to

Keyboard shortcuts

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