api

package
v0.0.0-...-b3db5e2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ApiVersion = 1

Variables

This section is empty.

Functions

func DecodeMessage

func DecodeMessage(in []byte) (out interface{}, token int64, err error)

func EncodeMessage

func EncodeMessage(in interface{}, token int64) (out []byte, err error)

Types

type AckCreate

type AckCreate struct {
	Id     int64 `json:"id"`
	Player int   `json:"player"`
}

type AckJoin

type AckJoin struct {
	Error    *string `json:"error"`
	Player   int     `json:"player"`
	RomImage *string `json:"rom_image"`
}

type Create

type Create struct {
	Name     string `json:"name"`
	RomImage string `json:"rom_image"`
}

client -> server messages

type Finish

type Finish struct {
}

type Join

type Join struct {
	Id int64 `json:"id"`
}

type ServerInfo

type ServerInfo struct {
	ApiVersion int `json:"api_version"`
}

server -> client messages

type Start

type Start struct {
	Delay int `json:"delay"`
}

type Sync

type Sync struct {
	KeysDown [2]string `json:"keys_down"`
	Tick     int64     `json:"tick"`
}

type Update

type Update struct {
	KeysDown string `json:"keys_down"`
	Tick     int64  `json:"tick"`
}

Jump to

Keyboard shortcuts

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