mpclient

package
v0.0.0-...-7dd518e Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocateResponse

type AllocateResponse struct {
	ProfileID int64
	UUID      string
	RegionID  string
	Created   string
	Error     string
}

AllocateResponse contains the response from the api

type AllocationResponse

type AllocationResponse struct {
	ProfileID int64
	UUID      string
	Regions   string
	Created   string
	Requested string
	Fulfilled string
	ServerID  int64
	FleetID   string
	RegionID  string
	MachineID int64
	IP        string
	GamePort  int `json:"game_port"`
	Error     string
}

type Config

type Config struct {
	AccessKey string `env:"MP_ACCESS_KEY"`
	SecretKey string `env:"MP_SECRET_KEY"`
}

Config holds configuration used to access the multiplay api

type MockMultiplayClient

type MockMultiplayClient struct {
}

func (MockMultiplayClient) Allocate

func (m MockMultiplayClient) Allocate(fleet, region string, profile int64, uuid string) (*AllocateResponse, error)

func (MockMultiplayClient) Allocations

func (m MockMultiplayClient) Allocations(fleet, region string, profile int64, uuid string) ([]AllocationResponse, error)

func (MockMultiplayClient) Deallocate

func (m MockMultiplayClient) Deallocate(fleet, uuid string) error

type MultiplayClient

type MultiplayClient interface {
	Allocate(fleet, region string, profile int64, uuid string) (*AllocateResponse, error)
	Allocations(fleet, region string, profile int64, uuid string) ([]AllocationResponse, error)
	Deallocate(fleet, uuid string) error
}

MultiplayClient represents something capable of interfacing with the multiplay API

func NewClient

func NewClient(cfg Config) MultiplayClient

NewClient creates a multiplay client

func NewClientFromEnv

func NewClientFromEnv() (MultiplayClient, error)

NewClientFromEnv creates a multiplay client from the environment

Jump to

Keyboard shortcuts

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