application

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KnownConfigKeys

func KnownConfigKeys(schema environschema.Fields) set.Strings

KnownConfigKeys returns the valid application config keys.

Types

type Config

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

Config encapsulates config for an application.

func NewConfig

func NewConfig(attrs map[string]interface{}, schema environschema.Fields, defaults schema.Defaults) (*Config, error)

NewConfig returns a new config instance with the given attributes and allowing for the extra provider attributes.

func (*Config) Attributes

func (c *Config) Attributes() ConfigAttributes

Attributes returns all the config attributes.

func (*Config) Validate

func (c *Config) Validate() error

Validate returns an error if the config is not valid.

type ConfigAttributes

type ConfigAttributes map[string]interface{}

ConfigAttributes is the config for an application.

func (ConfigAttributes) Get

func (c ConfigAttributes) Get(attrName string, defaultValue interface{}) interface{}

Get gets the specified attribute.

func (ConfigAttributes) GetBool

func (c ConfigAttributes) GetBool(attrName string, defaultValue bool) bool

GetInt gets the specified bool attribute.

func (ConfigAttributes) GetInt

func (c ConfigAttributes) GetInt(attrName string, defaultValue int) int

GetInt gets the specified int attribute.

func (ConfigAttributes) GetString

func (c ConfigAttributes) GetString(attrName string, defaultValue string) string

GetString gets the specified string attribute.

func (ConfigAttributes) GetStringMap

func (c ConfigAttributes) GetStringMap(attrName string, defaultValue map[string]string) (map[string]string, error)

GetStringMap gets the specified map attribute as map[string]string.

type GoalState

type GoalState struct {
	Units     UnitsGoalState
	Relations map[string]UnitsGoalState
}

GoalState is responsible to organize the Units and Relations with a specific unit, and transmit this information from the api to the worker.

type GoalStateStatus

type GoalStateStatus struct {
	Status string
	Since  *time.Time
}

GoalStateStatus keeps the status and timestamp of a unit.

type UnitsGoalState

type UnitsGoalState map[string]GoalStateStatus

UnitsGoalState keeps the collection of units and their GoalStateStatus

Jump to

Keyboard shortcuts

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