client

package
v1.0.0-beta68 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2016 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 CalibrationClient

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

CalibrationClient can be used to generate the dart matrix

func NewCalibrationClient

func NewCalibrationClient(board string) *CalibrationClient

NewCalibrationClient prepare a client for the calibration

func (*CalibrationClient) Consume

func (calibration *CalibrationClient) Consume(event hardware.InputEvent)

Consume handles next input

func (*CalibrationClient) Prepare

func (calibration *CalibrationClient) Prepare() error

Prepare prints the first output

func (*CalibrationClient) Shutdown

func (calibration *CalibrationClient) Shutdown()

Shutdown prints shutdown message

type DartClient

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

DartClient the API client

func NewClient

func NewClient(endpointURL string, board string) *DartClient

NewClient the client constructor

func (*DartClient) FireDart

func (client *DartClient) FireDart(sector int, multiplier int) (state common.GameState, err error)

FireDart sends a Dart to the server

func (*DartClient) Shutdown

func (client *DartClient) Shutdown()

Shutdown releases the resources held by the client

type Failure

type Failure struct {
	Error  string `json:"error,omitempty"`
	Status string `json:"status,omitempty"`
}

Failure is structure for failure response

type GameResponse

type GameResponse struct {
	ID   int       `json:"id,omitempty"`
	Game GameState `json:"game"`
}

GameResponse is container structure for GameState

type GameState

type GameState struct {
	State common.GameState
}

GameState is structure for state

type MockedClient

type MockedClient struct {
}

MockedClient testing purpose

func NewMockedClient

func NewMockedClient() *MockedClient

NewMockedClient MockedClient constructor

func (*MockedClient) Consume

func (mock *MockedClient) Consume(event hardware.InputEvent)

Consume mock implem

func (*MockedClient) Prepare

func (mock *MockedClient) Prepare() error

Prepare mock implem

func (*MockedClient) Shutdown

func (mock *MockedClient) Shutdown()

Shutdown mock implem

type WrappedClient

type WrappedClient struct {
	CurrentGameID   int
	LatestGameState GameState
	// contains filtered or unexported fields
}

WrappedClient is structure for manipulate Client

func NewWrappedClient

func NewWrappedClient(endpointURL string, board string) *WrappedClient

NewWrappedClient is WrappedClient constructor

func (*WrappedClient) Consume

func (wrapped *WrappedClient) Consume(event hardware.InputEvent)

Consume is

func (*WrappedClient) Shutdown

func (wrapped *WrappedClient) Shutdown()

Shutdown is

Jump to

Keyboard shortcuts

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