matchmaker

package
v0.0.0-...-6dd300b Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Version string = "matchmaker:0.2"

Version is the current api version number

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	ID        string `json:"id" redis:"id"`
	Status    int    `json:"status" redis:"status"`
	SessionID string `json:"sessionID,omitempty" redis:"sessionID"`
	Port      int    `json:"port,omitempty" redis:"port"`
	IP        string `json:"ip,omitempty" redis:"ip"`
}

Game represents a game that is being/has been match-made

func NewGame

func NewGame() *Game

NewGame returns a game, with a unique id

func (Game) Key

func (g Game) Key() string

Key returns the redis key for this Game

type Server

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

Server is the http server instance

func NewServer

func NewServer(hostAddr, redisAddr string, sessionAddr string) *Server

NewServer returns the HTTP Server instance

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server on the given port

type Session

type Session struct {
	ID   string `json:"id"`
	Port int    `json:"port,omitempty"`
	IP   string `json:"ip,omitempty"`
}

Session represents a game session

Directories

Path Synopsis
cmd
server
Server binary for session management
Server binary for session management

Jump to

Keyboard shortcuts

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