server

package
v0.0.0-...-bfb5f8b Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleMessage

func HandleMessage(c data.Client, message []byte)

func Listen

func Listen(port int)

Types

type CommandMessage

type CommandMessage struct {
	Cmd string `json:"cmd"`
}

type Hub

type Hub interface {
	Broadcast(interface{}) error
}

type WSClient

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

func (*WSClient) Broadcast

func (c *WSClient) Broadcast(v interface{})

func (*WSClient) Error

func (c *WSClient) Error(format string, v ...interface{})

func (*WSClient) GetPlayer

func (c *WSClient) GetPlayer() *data.Player

func (*WSClient) Host

func (c *WSClient) Host() string

func (*WSClient) Send

func (c *WSClient) Send(v interface{})

func (*WSClient) SetPlayer

func (c *WSClient) SetPlayer(p *data.Player)

type WSHub

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

This class taken almost directly from https://github.com/gorilla/websocket/blob/master/examples/chat/hub.go

func (*WSHub) Broadcast

func (h *WSHub) Broadcast(v interface{}) error

Jump to

Keyboard shortcuts

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