server

package
v0.0.0-...-7de0d12 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	*websocket.Conn
}

func (*Conn) Send

func (conn *Conn) Send(data interface{})

func (*Conn) SendError

func (conn *Conn) SendError(err string)

type Map

type Map map[string]interface{}

type Player

type Player struct {
	Username string `json:"username"`
	// contains filtered or unexported fields
}

type Server

type Server struct {
	Players map[string]*Player

	Root         string
	Debug        bool
	LayoutBuffer []byte

	http.Server
	// contains filtered or unexported fields
}

func New

func New(port int, debug bool) (*Server, error)

func (*Server) HandleMessage

func (s *Server) HandleMessage(source *Player, message Map) error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) LoadManifest

func (s *Server) LoadManifest()

func (*Server) RelayInviteCommand

func (s *Server) RelayInviteCommand(command string, source *Player, message Map)

func (*Server) ServeLayout

func (s *Server) ServeLayout(w http.ResponseWriter, r *http.Request)

func (*Server) ServeWS

func (s *Server) ServeWS(w http.ResponseWriter, r *http.Request)

type Session

type Session struct {
	Type string `json:"type"`
	Host string `json:"host"`
}

Jump to

Keyboard shortcuts

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