api

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetRoom      = "get_room"
	CloseRoom    = "close_room"
	RegisterRoom = "register_room"
	Heartbeat    = "heartbeat"
	IceCandidate = "ice_candidate"

	NoData = ""

	InitWebrtc = "init_webrtc"
	Answer     = "answer"

	GameStart        = "start"
	GameQuit         = "quit"
	GameSave         = "save"
	GameLoad         = "load"
	GamePlayerSelect = "player_index"
	GameMultitap     = "multitap"
)
View Source
const (
	ServerId         = "server_id"
	TerminateSession = "terminateSession"
)

Variables

This section is empty.

Functions

func CloseRoomPacket

func CloseRoomPacket(data string) cws.WSPacket

func ConfigRequestPacket

func ConfigRequestPacket(conf []byte) cws.WSPacket

func GetRoomPacket

func GetRoomPacket(data string) cws.WSPacket

func IceCandidatePacket

func IceCandidatePacket(data string, sessionId string) cws.WSPacket

func RegisterRoomPacket

func RegisterRoomPacket(data string) cws.WSPacket

func ServerIdPacket

func ServerIdPacket(id string) cws.WSPacket

func TerminateSessionPacket

func TerminateSessionPacket(sessionId string) cws.WSPacket

Types

type ConfPushCall

type ConfPushCall struct {
	Data []byte `json:"data"`
}

func (*ConfPushCall) From

func (packet *ConfPushCall) From(data string) error

func (*ConfPushCall) To

func (packet *ConfPushCall) To() (string, error)

type ConnectionRequest added in v2.6.0

type ConnectionRequest struct {
	Zone     string `json:"zone,omitempty"`
	PingAddr string `json:"ping_addr,omitempty"`
	IsHTTPS  bool   `json:"is_https,omitempty"`
}

type GameStartCall

type GameStartCall struct {
	Name string `json:"name"`
	Base string `json:"base"`
	Path string `json:"path"`
	Type string `json:"type"`
}

func (*GameStartCall) From

func (packet *GameStartCall) From(data string) error

func (*GameStartCall) To

func (packet *GameStartCall) To() (string, error)

type GameStartRequest

type GameStartRequest struct {
	GameName string `json:"game_name"`
}

func (*GameStartRequest) From

func (packet *GameStartRequest) From(data string) error

Jump to

Keyboard shortcuts

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