allocator

package
v0.0.0-...-de3990d Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocationRequest

type AllocationRequest struct {
	ModuleID           int    `json:"module_id,omitempty"`
	OrgID              int    `json:"org_id,omitempty"`
	ImageRegistry      string `json:"image_registry,omitempty"`
	Engine             string `json:"engine,omitempty"`
	BackfillID         string `json:"backfill_id,omitempty"`
	AllocateGameServer bool   `json:"allocate_game_server,omitempty"`
	ServerVersion      string `json:"server_version,omitempty"`
}

type AllocationResponse

type AllocationResponse struct {
	Results GameServer `json:"results"`
	Error   error      `json:"error"`
}

type Allocator

type Allocator interface {
	AllocateGameserver(request AllocationRequest) AllocationResponse
	RegisterFleet(fleet FleetRequest) Response
	DeregisterFleet(fleet FleetRequest) Response
	RegisterTrigger(trigger platform.MultiplayerServerTrigger) Response
	UpdateTrigger(trigger platform.MultiplayerServerTrigger) Response
	DeleteTrigger(id int) Response
}

type AllocatorClient

type AllocatorClient struct {
	abstractClient.AbstractServiceClient
}

AllocatorClient is a struct for the primary API that contains an abstract client

func NewClient

func NewClient(config urlfinder.ClientConfig) *AllocatorClient

NewClient is a function that returns a AbstractServiceClient

func NewClientWithBasicAuth

func NewClientWithBasicAuth(username, password string, config urlfinder.ClientConfig) (*AllocatorClient, error)

func (*AllocatorClient) AllocateGameserver

func (a *AllocatorClient) AllocateGameserver(request AllocationRequest) AllocationResponse

func (*AllocatorClient) DeleteTrigger

func (a *AllocatorClient) DeleteTrigger(id int) Response

func (*AllocatorClient) DeregisterFleet

func (a *AllocatorClient) DeregisterFleet(request FleetRequest) Response

func (*AllocatorClient) GetBuildWorkflowLogs

func (a *AllocatorClient) GetBuildWorkflowLogs(workflowName string) (chan *argo.Log, error)

func (*AllocatorClient) GetBuildWorkflows

func (a *AllocatorClient) GetBuildWorkflows() ([]Workflow, error)

func (*AllocatorClient) RegisterFleet

func (a *AllocatorClient) RegisterFleet(request FleetRequest) Response

func (*AllocatorClient) RegisterTrigger

func (a *AllocatorClient) RegisterTrigger(trigger platform.MultiplayerServerTrigger) Response

func (*AllocatorClient) UpdateTrigger

func (a *AllocatorClient) UpdateTrigger(trigger platform.MultiplayerServerTrigger) Response

type AllocatorSpy

type AllocatorSpy struct {
	CalledAllocateGameserver bool
	CalledRegisterFleet      bool
	CalledDeregisterFleet    bool
	CalledRegisterTrigger    bool
	CalledUpdateTrigger      bool
	CalledDeleteTrigger      bool
}

func NewAllocatorSpy

func NewAllocatorSpy() *AllocatorSpy

func (*AllocatorSpy) AllocateGameserver

func (a *AllocatorSpy) AllocateGameserver(request AllocationRequest) AllocationResponse

func (*AllocatorSpy) DeleteTrigger

func (a *AllocatorSpy) DeleteTrigger(id int) Response

func (*AllocatorSpy) DeregisterFleet

func (a *AllocatorSpy) DeregisterFleet(fleet FleetRequest) Response

func (*AllocatorSpy) RegisterFleet

func (a *AllocatorSpy) RegisterFleet(fleet FleetRequest) Response

func (*AllocatorSpy) RegisterTrigger

func (a *AllocatorSpy) RegisterTrigger(trigger platform.MultiplayerServerTrigger) Response

func (*AllocatorSpy) UpdateTrigger

func (a *AllocatorSpy) UpdateTrigger(trigger platform.MultiplayerServerTrigger) Response

type FleetRequest

type FleetRequest struct {
	ServerConfig  platform.MultiplayerServerConfig  `json:"serverConfig,omitempty"`
	ServerVersion platform.MultiplayerServerVersion `json:"serverVersion,omitempty"`
}

type GameServer

type GameServer struct {
	Name           string   `json:"resource_name,omitempty"`
	IP             string   `json:"ipaddress,omitempty"`
	Port           string   `json:"port,omitempty"`
	SessionName    string   `json:"session_name,omitempty"`
	SessionID      string   `json:"session_id,omitempty"`
	OwningUserName string   `json:"owning_user_name,omitempty"`
	OrgID          int      `json:"org_id,omitempty"`
	ModuleID       int      `json:"module_id,omitempty"`
	ServerVersion  string   `json:"server_version,omitempty"`
	MapName        string   `json:"map_name,omitempty"`
	State          string   `json:"state,omitempty"`
	NumPlaying     int      `json:"num_playing,omitempty"`
	Players        []string `json:"players,omitempty"`
	NumBackfill    int      `json:"num_backfill,omitempty"`
	Capacity       int      `json:"capacity,omitempty"`
	Logs           string   `json:"logs,omitempty"`
	SidecarLogs    string   `json:"sidecar_logs,omitempty"`
	CreatedAt      string   `json:"created_at,omitempty"`
}

type Response

type Response struct {
	HTTPResponse *resty.Response `json:"http_response"`
	Error        error           `json:"error"`
}

type Workflow

type Workflow struct {
	Name      string    `json:"name"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"createdAt"`
}

type WorkflowsResponse

type WorkflowsResponse struct {
	Message   string
	Workflows []Workflow
}

Jump to

Keyboard shortcuts

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