repo

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffData added in v0.0.3

type DiffData struct {
	Mean         uint32
	Median       uint32
	Percentile95 uint32
	Percentile99 uint32
	Max          uint32
}

type GameServer

type GameServer struct {
	ID              string
	Address         string
	HealthCheckAddr string
	GRPCAddress     string
	RealmID         uint32
	AvailableMaps   []uint32

	ActiveConnections uint32
	Diff              DiffData

	// AssignedMapsToHandle list of maps that loadbalancer algorithm assigned for this server.
	AssignedMapsToHandle []uint32

	// AssignedButPendingMaps list of new maps that were assigned,
	// but we are still waiting for confirmation from GameServer,
	// that these maps are loaded and game server is ready to handle them.
	AssignedButPendingMaps []uint32
}

func (*GameServer) CanHandleMap added in v0.0.2

func (g *GameServer) CanHandleMap(id uint32) bool

func (*GameServer) Copy added in v0.0.2

func (g *GameServer) Copy() GameServer

func (*GameServer) HealthCheckAddress

func (g *GameServer) HealthCheckAddress() string

func (*GameServer) IsAllMapsAvailable

func (g *GameServer) IsAllMapsAvailable() bool

func (*GameServer) MetricsAddress added in v0.0.3

func (g *GameServer) MetricsAddress() string

type GameServerRepo

type GameServerRepo interface {
	Upsert(context.Context, *GameServer) error
	Update(ctx context.Context, id string, f func(*GameServer) *GameServer) error
	Remove(ctx context.Context, id string) error
	ListByRealm(ctx context.Context, realmID uint32) ([]GameServer, error)
	One(ctx context.Context, id string) (*GameServer, error)
}

func NewGameServerInMemRepo

func NewGameServerInMemRepo() GameServerRepo

func NewGameServerRedisRepo

func NewGameServerRedisRepo(rdb *redis.Client) GameServerRepo

type LoadBalancerRepo

type LoadBalancerRepo interface {
	Add(context.Context, *LoadBalancerServer) (*LoadBalancerServer, error)
	Update(ctx context.Context, id string, f func(LoadBalancerServer) LoadBalancerServer) error
	Remove(ctx context.Context, healthCheckAddress string) error
	ListByRealm(ctx context.Context, realmID uint32) ([]LoadBalancerServer, error)
}

func NewLoadBalancerInMemRepo

func NewLoadBalancerInMemRepo() LoadBalancerRepo

func NewLoadBalancerRedisRepo

func NewLoadBalancerRedisRepo(rdb *redis.Client) LoadBalancerRepo

type LoadBalancerServer

type LoadBalancerServer struct {
	ID                string
	Address           string
	HealthCheckAddr   string
	RealmID           uint32
	ActiveConnections int
}

func (*LoadBalancerServer) HealthCheckAddress

func (g *LoadBalancerServer) HealthCheckAddress() string

func (*LoadBalancerServer) MetricsAddress

func (g *LoadBalancerServer) MetricsAddress() string

Jump to

Keyboard shortcuts

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