engine

package
v0.0.0-...-fa7ffed Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

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

Card is a card of deck

func NewCard

func NewCard(value float32, name string) *Card

NewCard is a constructor

type Client

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

Client model

func NewClient

func NewClient(ws *websocket.Conn, server *Server) *Client

NewClient is a constructor

func (*Client) Conn

func (c *Client) Conn() *websocket.Conn

Conn returns websocket connection

func (*Client) Done

func (c *Client) Done()

Done is terminate session

func (*Client) Listen

func (c *Client) Listen()

Listen write and read events

func (*Client) Write

func (c *Client) Write(msg *Message)

type Deck

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

Deck is a collection of cards

func NewDeck

func NewDeck() *Deck

NewDeck is a constructor

type Message

type Message struct {
	Author string `json:"author"`
	Body   string `json:"body"`
}

Message model

func (*Message) String

func (m *Message) String() string

String – model to string

type Player

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

Player is a user who envolved in estimation process

func NewPlayer

func NewPlayer(client Client) *Player

NewPlayer is a constructor

type Room

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

Room is a place where players estimate

func NewRoom

func NewRoom(name string) *Room

NewRoom is a constructor

type Server

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

Server App server

func NewServer

func NewServer(pattern string) *Server

NewServer Create new app server

func (*Server) Add

func (s *Server) Add(c *Client)

Add new player

func (*Server) Del

func (s *Server) Del(c *Client)

Del player go out

func (*Server) Done

func (s *Server) Done()

Done with servers work

func (*Server) Err

func (s *Server) Err(err error)

Err – an error happened

func (*Server) Listen

func (s *Server) Listen()

Listen and serve. It serves client connection and broadcast request.

func (*Server) SendAll

func (s *Server) SendAll(msg *Message)

SendAll – message to channel

Jump to

Keyboard shortcuts

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