controller

package
v0.0.0-...-cb3e436 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVENT_SOURCE      = "https://github.com/n3wscott/sources/cmd/demos/salmonrun"
	SALMON_EVENT_TYPE = "com.github.n3wscott.sources.demos.salmonrun.salmon"
	BEAR_EVENT_TYPE   = "com.github.n3wscott.sources.demos.salmonrun.bear"
)

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(svr *moron.Server, role, datapath string) error

Types

type ConnectionReceiver

type ConnectionReceiver func(player Player, conn *websocket.Conn)

A ConnectionReceiver is used to process messages on a websocket.

type ConnectionSender

type ConnectionSender func(msg *Message)

A ConnectionSender sends messages on a websocket.

type Message

type Message struct {
	Type  string `json:"type,omitempty"`
	From  Player `json:"from,omitempty"`
	To    Player `json:"to",omitempty"`
	Nonce string `json:"nonce,omitempty"`
}

type Player

type Player struct {
	Name string `json:"name,omitempty"`
	UUID string `json:"uuid,omitempty"`
}

func (*Player) Key

func (p *Player) Key() string

Jump to

Keyboard shortcuts

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