client

package
v0.0.0-...-5184234 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MessengerBufferSize = 16

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, username string, conn *grpc.ClientConn) (*Client, error)

func (*Client) Events

func (c *Client) Events() <-chan *mafiapb.GameEvent

func (*Client) ForwardEvents

func (c *Client) ForwardEvents()

func (*Client) GetState

func (c *Client) GetState() (*mafiapb.GetGameStateResponse, error)

func (*Client) SendMessage

func (c *Client) SendMessage(content string) (receivers uint, err error)

func (*Client) VoteKick

func (c *Client) VoteKick(username string) error

func (*Client) VoteKill

func (c *Client) VoteKill(username string) error

type Engine

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

func NewEngine

func NewEngine(ctx context.Context, client *Client, messenger *Messenger) *Engine

func (*Engine) Start

func (e *Engine) Start()

type Messenger

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

func NewMessenger

func NewMessenger(ctx context.Context) *Messenger

func (*Messenger) Input

func (m *Messenger) Input() <-chan string

func (*Messenger) Output

func (m *Messenger) Output() chan<- string

func (*Messenger) Start

func (m *Messenger) Start()

Jump to

Keyboard shortcuts

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