localproxytest

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockLocalProxy

type MockLocalProxy struct {
	// Server handles arbitrary HTTP requests.
	Server *httptest.Server

	// Node is a centrifuge broker node handled via websockets.
	Node *centrifuge.Node

	// Host is the hostname of the proxy, including protocol.
	Host string

	// JWT is the mock token this instance of the mock uses.
	JWT string

	// ReserveResponse is the reservation request response this mock uses.
	ReserveResponse *model.ReserveResponse

	// HoldStatus is the status of a server hold, the response this mock uses.
	HoldStatus *model.HoldStatus

	// PatchAllocationRequests is a map of the last requests made to patch each
	// allocation. This is used to verify the request body.
	PatchAllocationRequests map[string]*model.PatchAllocationRequest
}

MockLocalProxy represents a mock implementation of the Game Server Hosting machine-local proxy.

func NewLocalProxy

func NewLocalProxy() (*MockLocalProxy, error)

NewLocalProxy sets up a new websocket server with centrifuge which accepts all connections and subscriptions. It also handles the JWT token endpoint.

func (*MockLocalProxy) Close

func (s *MockLocalProxy) Close()

Close closes the testing SDK server.

Jump to

Keyboard shortcuts

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