hosting

package
v0.0.0-...-e6657e5 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoServersAvailable = errors.New("no servers available")
)

Functions

func GetKeyFromKV

func GetKeyFromKV(ctx context.Context, kv kv.Bucket, key string, obj any) error

func SetKeyToKV

func SetKeyToKV(ctx context.Context, kv kv.Bucket, key string, obj any) error

Types

type Hosting

type Hosting struct {
	Info *PodInfo
	// contains filtered or unexported fields
}

func Init

func Init() (*Hosting, error)

func (*Hosting) InstanceManager

func (h *Hosting) InstanceManager(ctx context.Context, prx *proxy.Proxy) (*InstanceManager, error)

func (*Hosting) KV

func (n *Hosting) KV() kv.Client

func (*Hosting) Messaging

func (n *Hosting) Messaging() messaging.Messager

func (*Hosting) Storage

func (n *Hosting) Storage() storage.Storage

type InstanceInfo

type InstanceInfo struct {
	Gamemode string `json:"gamemode"`
	Address  string `json:"address"`
	Port     int    `json:"port"`
}

type InstanceManager

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

func (*InstanceManager) GetRandomServerOfGamemode

func (m *InstanceManager) GetRandomServerOfGamemode(ctx context.Context, gamemode string) (proxy.RegisteredServer, error)

func (*InstanceManager) GetServersOfGamemode

func (m *InstanceManager) GetServersOfGamemode(ctx context.Context, gamemode string) ([]proxy.RegisteredServer, error)

func (*InstanceManager) Register

func (m *InstanceManager) Register(ctx context.Context, name string, info InstanceInfo) error

func (*InstanceManager) Unregister

func (m *InstanceManager) Unregister(ctx context.Context, name string) error

type PodInfo

type PodInfo struct {
	Network      string
	PodName      string
	PodNamespace string
}

func ParsePodInfo

func ParsePodInfo() *PodInfo

func (PodInfo) DebugString

func (p PodInfo) DebugString() string

func (PodInfo) KVGamemodesKey

func (p PodInfo) KVGamemodesKey() string

func (PodInfo) KVInstancesKey

func (p PodInfo) KVInstancesKey() string

csmc_<namespace>_<network>_instances<Container hostname, InstanceInfo>

func (PodInfo) KVNetworkKey

func (p PodInfo) KVNetworkKey() string

func (PodInfo) RPCNetworkSubject

func (p PodInfo) RPCNetworkSubject() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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