config

package
v0.0.0-...-33bb219 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetApps(userID string) (tasks []*demand.Task, maxContainers int, err error)
}

Config is an interface for retrieving task config - could be hardcoded, from the server, from a file etc

type EnvVarConfig

type EnvVarConfig struct {
	EnvVarValue string
}

EnvVarConfig is used when we retrieve config from an environment variable.

func NewEnvVarConfig

func NewEnvVarConfig(EnvVarValue string) *EnvVarConfig

NewEnvVarConfig gets a new EnvVarConfig.

func (*EnvVarConfig) GetApps

func (e *EnvVarConfig) GetApps(userID string) (tasks []*demand.Task, maxContainers int, err error)

GetApps retrieves tasks from the environment variable.

type HardcodedConfig

type HardcodedConfig struct{}

HardcodedConfig is used for testing

func NewHardcodedConfig

func NewHardcodedConfig() *HardcodedConfig

NewHardcodedConfig gets a new hardcoded config

func (*HardcodedConfig) GetApps

func (c *HardcodedConfig) GetApps(userID string) (tasks []*demand.Task, maxContainers int, err error)

GetApps returns hardcoded task config

type KubeLabelConfig

type KubeLabelConfig struct {
	APIAddress    string
	KubeConfig    string
	KubeNamespace string
}

KubeLabelConfig is used when we retrieve get image config from the Microscaling server and then get label config from MicroBadger APIs

func NewKubeLabelConfig

func NewKubeLabelConfig(APIAddress string, KubeConfig string, KubeNamespace string) *KubeLabelConfig

NewKubeLabelConfig gets a new KubeLabelConfig

func (*KubeLabelConfig) GetApps

func (kl *KubeLabelConfig) GetApps(userID string) (tasks []*demand.Task, maxContainers int, err error)

GetApps retrieves task config from the server using the API, gets the Docker image from the Kubernetes deployments API and then gets scaling parameters from labels using MicroBadger

type LabelConfig

type LabelConfig struct {
	APIAddress string
}

LabelConfig is used when we retrieve get image config from the Microscaling server and then get label config from MicroBadger APIs

func NewLabelConfig

func NewLabelConfig(APIAddress string) *LabelConfig

NewLabelConfig gets a new LabelConfig

func (*LabelConfig) GetApps

func (l *LabelConfig) GetApps(userID string) (tasks []*demand.Task, maxContainers int, err error)

GetApps retrieves task config from the server using the API, and then gets scaling parameters from labels using MicroBadger

type ServerConfig

type ServerConfig struct {
	APIAddress string
}

ServerConfig is used when we retrieve config over the API from the server

func NewServerConfig

func NewServerConfig(APIAddress string) *ServerConfig

NewServerConfig gets a new ServerConfig

func (*ServerConfig) GetApps

func (s *ServerConfig) GetApps(userID string) (tasks []*demand.Task, maxContainers int, err error)

GetApps retrieves task config from the server using the API

Jump to

Keyboard shortcuts

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