Documentation ¶
Index ¶
- Variables
- type Connection
- type Manager
- func (m *Manager) CreateRoom(roomID string) (bool, error)
- func (m *Manager) Disconnected(connectionID string) error
- func (m *Manager) EnterRoom(connID string, roomID string) error
- func (m *Manager) FindConnection(connectionID string) (*Connection, error)
- func (m *Manager) FindRoomMates(roomID string) ([]Connection, error)
- func (m *Manager) NewConnection(connectionID string) error
- func (m *Manager) RetrieveRoomConnections(roomID string) ([]*Connection, error)
- type Room
Constants ¶
This section is empty.
Variables ¶
View Source
var ConnectionTableName string
ConnectionTableName the name of dynamodb table
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { // ConnectionID request.RequestContext.ConnectionID PK string `json:"pk"` ConnectionID string `json:"connectionID"` RoomID string `json:"roomID"` Username string `json:"username"` }
Connection dynamodb record structure
func NewConnection ¶
func NewConnection(connectionID string) *Connection
NewConnection new connection record
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manage connection
func NewManager ¶
NewManager returns connection manager instance
func (*Manager) CreateRoom ¶
CreateRoom create room
func (*Manager) Disconnected ¶
Disconnected cleanup records beside connection
func (*Manager) FindConnection ¶
func (m *Manager) FindConnection(connectionID string) (*Connection, error)
FindConnection find out connection record from table
func (*Manager) FindRoomMates ¶
func (m *Manager) FindRoomMates(roomID string) ([]Connection, error)
FindRoomMates find all room mates
func (*Manager) NewConnection ¶
NewConnection make new connection and store to table
func (*Manager) RetrieveRoomConnections ¶
func (m *Manager) RetrieveRoomConnections(roomID string) ([]*Connection, error)
RetrieveRoomConnections retrieve connections at same room
Click to show internal directories.
Click to hide internal directories.