server

package
v0.0.0-...-f03492f Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2018 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start()

Start starts web server

Types

type Client

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

Client is a user connected to websocket

type Hub

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

type PlayerQueue

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

PlayerQueue holds all users, who are waiting for a game.

func (*PlayerQueue) Append

func (q *PlayerQueue) Append(c *Client)

Append adds user to end of queue

func (*PlayerQueue) ContainsUser

func (q *PlayerQueue) ContainsUser(u entity.User) bool

ContainsUser checks if queue contains user

func (*PlayerQueue) Pop

func (q *PlayerQueue) Pop() *Client

Pop removes first user from queue and returns it if queue is empty, nil is returned

func (*PlayerQueue) Remove

func (q *PlayerQueue) Remove(c *Client)

Remove removes user form queue

func (*PlayerQueue) Size

func (q *PlayerQueue) Size() int

Size returns the amount of useres in the queue

Jump to

Keyboard shortcuts

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