allocator

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocation

type Allocation struct {
	Address string
	Port    int32
}

Allocation is a game server allocation

type Client

type Client struct {
	// CA is a list of CAs to consider valid for the respsonse
	CA []byte
	// ClientCert is the client certificate to use for gRPC communication
	ClientCert []byte
	// ClientKey is the key corresponding to ClientCert
	ClientKey []byte
	// Endpoints is a map of possible allocators and their corresponding pingServers
	// if there is no ping server for that allocator, then the value is an empty string
	Endpoints map[string]string
	// Namespace is the namespace of the fleet or set of gameservers we wish to allocate from
	Namespace string
	// Multicluster is a boolean indicating if a multi-cluster request should be made
	Multicluster bool
	// Endpoint is the chose endpoint after checkPing is resolved
	Endpoint string
	// DialOpts is a constructed grpc DialOption that is used to make requests
	DialOpts grpc.DialOption
	// MatchLabels is a map of key/value pairs to send when asking for an allocation
	MatchLabels map[string]string
	// MaxRetries is the maximum number of times to retry allocations
	MaxRetries int
	// MetaPatch is metadata to set on the gameserver
	MetaPatch *pb.MetaPatch
}

Client is all of the things necessary to build an allocator request

func NewClient

func NewClient(keyFile, certFile, cacertFile, namespace string, multiCluster bool, labelSelector map[string]string, hosts []string, pingHosts map[string]string, maxRetries int) (*Client, error)

NewClient builds a new client object

func (*Client) AllocateGameserverWithRetry added in v0.1.0

func (c *Client) AllocateGameserverWithRetry() (*Allocation, error)

AllocateGameserverWithRetry will retry multiple times

func (*Client) RunLoad added in v0.2.0

func (c *Client) RunLoad(count int, delay int, duration int, proto string) error

RunLoad runs many concurrent game connections on a simple UDP or TCP server This is designed to test the allocator service and autoscaling of the game servers.

Jump to

Keyboard shortcuts

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