controllers

package
v0.0.0-...-af0835f Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerHelper

type ControllerHelper struct {
	Workqueue workqueue.RateLimitingInterface
	// contains filtered or unexported fields
}

ControllerHelper contains shared methods and fields used by Controllers in this project

func NewControllerHelper

func NewControllerHelper(workqueue workqueue.RateLimitingInterface, logger *logrus.Logger, syncHandler func(string) error, controllerType string, cacheSyncs []cache.InformerSynced) *ControllerHelper

NewControllerHelper returns a new ControllerHelper instance

func (*ControllerHelper) Run

func (c *ControllerHelper) Run(controllerThreadiness int, stopCh <-chan struct{}) error

Run waits for caches to sync and then initializes the Controller's worker

type PortRegistry

type PortRegistry struct {
	Ports             map[int32]bool
	Indexes           []int32
	NextFreePortIndex int32
	Min               int32 // Minimum Port
	Max               int32 // Maximum Port
	// contains filtered or unexported fields
}

PortRegistry implements a custom map for the port registry

func NewPortRegistry

func NewPortRegistry(dgsclientset dgsclientset.Interface, min, max int32, namespace string) (*PortRegistry, error)

NewPortRegistry initializes the IndexedDictionary that holds the port registry.

func (*PortRegistry) DeregisterServerPorts

func (pr *PortRegistry) DeregisterServerPorts(ports []int32)

DeregisterServerPorts deregisters all ports

func (*PortRegistry) GetNewPort

func (pr *PortRegistry) GetNewPort() (int32, error)

GetNewPort returns and registers a new port for the designated game server. Locks a mutex

func (*PortRegistry) Stop

func (pr *PortRegistry) Stop()

Stop stops port registry mechanism by closing requests and responses channels

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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