clients

package
v0.0.2-0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingConfigField = errors.New("missing field in config")

ErrMissingConfigField occurs when a config field is missing

View Source
var ErrUnexpectedStatus = errors.New("unexpected status")

ErrUnexpectedStatus occurs when an unexpects http status is encountered

Functions

This section is empty.

Types

type GameQuerySubscription

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

GameQuerySubscription is a subscription to the game state

func (*GameQuerySubscription) Cancel

func (s *GameQuerySubscription) Cancel()

Cancel will end and cleanup the subscription

func (*GameQuerySubscription) NextState

func (s *GameQuerySubscription) NextState() (
	state *models.GameQueryState,
	err error,
)

NextState will return the next state

type GameyeClient

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

GameyeClient is a simple wrapper for the gameye api, please use NewGameyeClient to create an instance

func NewGameyeClient

func NewGameyeClient(config GameyeClientConfig) (
	client GameyeClient,
)

NewGameyeClient will create a new GameyeClient

func (GameyeClient) CommandStartMatch

func (client GameyeClient) CommandStartMatch(
	matchKey string,
	gameKey string,
	locationKeys []string,
	templateKey string,
	config map[string]interface{},
) (err error)

CommandStartMatch will start a match @param matchKey a unique identifier for this match, you will use this identifier to refer to this match in the future @param gameKey identifier of the game @param locationKeys list of location identifiers, if the first one is not available, the second one is tried and so on. @param templateKey identifier of the template for this game to use @param config configuration of the template

func (GameyeClient) CommandStopMatch

func (client GameyeClient) CommandStopMatch(
	matchKey string,
) (err error)

CommandStopMatch will stop a match @param matchKey Identifer of the match

func (GameyeClient) QueryGame

func (client GameyeClient) QueryGame() (
	state *models.GameQueryState,
	err error,
)

QueryGame will Fetch the game state

func (GameyeClient) QueryMatch

func (client GameyeClient) QueryMatch() (
	state *models.MatchQueryState,
	err error,
)

QueryMatch will fetch the match state

func (GameyeClient) QueryStatistic

func (client GameyeClient) QueryStatistic(
	matchKey string,
) (
	state *models.StatisticQueryState,
	err error,
)

QueryStatistic will fetch statistic state @param matchKey identifier of the match

func (GameyeClient) QueryTemplate

func (client GameyeClient) QueryTemplate(
	gameKey string,
) (
	state *models.TemplateQueryState,
	err error,
)

QueryTemplate will fetch template state @param gameKey identifier of the game

func (GameyeClient) SubscribeGame

func (client GameyeClient) SubscribeGame() (
	subscription *GameQuerySubscription,
	err error,
)

SubscribeGame subscribes to the game state

func (GameyeClient) SubscribeMatch

func (client GameyeClient) SubscribeMatch() (
	subscription *MatchQuerySubscription,
	err error,
)

SubscribeMatch will subscribe to the match state

func (GameyeClient) SubscribeStatistic

func (client GameyeClient) SubscribeStatistic(
	matchKey string,
) (
	subscription *StatisticQuerySubscription,
	err error,
)

SubscribeStatistic will subscribe to statistic state @param matchKey identifier of the match

func (GameyeClient) SubscribeTemplate

func (client GameyeClient) SubscribeTemplate(
	gameKey string,
) (
	subscription *TemplateQuerySubscription,
	err error,
)

SubscribeTemplate will subscribe to template state @param gameKey identifier of the game

type GameyeClientConfig

type GameyeClientConfig struct {
	Endpoint string
	Token    string
}

GameyeClientConfig configures the GameyeClient

type MatchQuerySubscription

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

MatchQuerySubscription is a subscription to the match state

func (*MatchQuerySubscription) Cancel

func (s *MatchQuerySubscription) Cancel()

Cancel will end and cleanup the subscription

func (*MatchQuerySubscription) NextState

func (s *MatchQuerySubscription) NextState() (
	state *models.MatchQueryState,
	err error,
)

NextState will return the next state

type StatisticQuerySubscription

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

StatisticQuerySubscription is a subscription to the statistic state

func (*StatisticQuerySubscription) Cancel

func (s *StatisticQuerySubscription) Cancel()

Cancel will end and cleanup the subscription

func (*StatisticQuerySubscription) NextState

func (s *StatisticQuerySubscription) NextState() (
	state *models.StatisticQueryState,
	err error,
)

NextState will return the next state

type TemplateQuerySubscription

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

TemplateQuerySubscription is a subscription to the template state

func (*TemplateQuerySubscription) Cancel

func (s *TemplateQuerySubscription) Cancel()

Cancel will end and cleanup the subscription

func (*TemplateQuerySubscription) NextState

func (s *TemplateQuerySubscription) NextState() (
	state *models.TemplateQueryState,
	err error,
)

NextState will return the next state

Jump to

Keyboard shortcuts

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