config

package
v0.0.0-...-3e52749 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoreDefaultTraceLevel      = 1
	StoreDefaultConnectTimeout  = 5
	StoreDefaultRequestTimeout  = 5
	StoreDefaultEtcdSvcHostname = "localhost"
	StoreDefaultEtcdSvcPort     = 2379
)

Default values for the configurable parameters

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerType

type ControllerType struct {
	// Exposed GRPC endpoint
	EP        Endpoint
	TraceFile string
}

ControllerType is a helper type describes the controllerd configuration settings

func (*ControllerType) Validate

func (ct *ControllerType) Validate(name string) error

Validate ensures that a controller configuration contains minimally legal values.

type DelayTypeInventory

type DelayTypeInventory struct {
	SetPower      common.Range
	SetConnection common.Range
	Booting       common.Range
}

DelayTypeInventory defines the simulated propagation or execution delays for particular simulated inventory actions.

func (*DelayTypeInventory) Validate

func (dt *DelayTypeInventory) Validate(name string) error

Validate ensures that the simulated inventory delay settings are legal.

type DelaysType

type DelaysType struct {
	Inventory DelayTypeInventory
}

DelaysType defines the simulated delays used in the CloudChamber services.

func (*DelaysType) Validate

func (dt *DelaysType) Validate(name string) error

Validate ensures that the CloudChamber simulated delay settings are legal.

type Endpoint

type Endpoint struct {
	Hostname string
	Port     uint16
}

Endpoint is a helper type that defines a simple endpoint

func (*Endpoint) String

func (e *Endpoint) String() string

String provides a formatted 'host:port' string for the endpoint

func (*Endpoint) Validate

func (e *Endpoint) Validate(name string) error

Validate ensures that an Endpoint contains minimally legal values.

type GlobalConfig

type GlobalConfig struct {
	Controller ControllerType
	Inventory  InventoryType
	SimSupport SimSupportType
	WebServer  WebServerType
	Store      StoreType
	Delays     DelaysType
	Tracing    TracingType
}

GlobalConfig defines the global configuration structure produced from reading the config files. It is structured by the internal services, with each internal service having room for the specific settings that it needs.

func ReadGlobalConfig

func ReadGlobalConfig(path string) (*GlobalConfig, error)

ReadGlobalConfig is a routine to read the configuration file at the specified path.

The configuration file is parsed, and the result returned as a typed object

func (*GlobalConfig) String

func (data *GlobalConfig) String() string

ToString is a function to format the configuration data as a returned string.

func (*GlobalConfig) Validate

func (data *GlobalConfig) Validate() error

Validate checks the contents of the global configuration instance for legal values. It returns an error if an illegal value is encountered.

type InventoryType

type InventoryType struct {
	// Exposed GRPC endpoint
	EP                  Endpoint
	TraceFile           string
	InventoryDefinition string
}

InventoryType is a helper type that describes the inventoryd configuration settings

func (*InventoryType) Validate

func (it *InventoryType) Validate(name string) error

Validate checks that the fields in the InventoryType instance are legal.

type SimSupportType

type SimSupportType struct {
	// Exposed GRPC endpoint
	EP        Endpoint
	TraceFile string

	// Name of the initial stepper policy to apply
	StepperPolicy string
}

SimSupportType is a helper type that describes the sim_supportd configuration settings

func (SimSupportType) GetPolicyType

func (sst SimSupportType) GetPolicyType() pb.StepperPolicy

GetPolicyType is a function that returns the configured default policy as the protobuf-defined enum value.

func (*SimSupportType) Validate

func (sst *SimSupportType) Validate(name string) error

Validate ensures that the simulation support service configuration contains minimally legal values.

type StoreType

type StoreType struct {
	ConnectTimeout int
	RequestTimeout int
	TraceLevel     int
	EtcdService    Endpoint
	Test           StoreTypeTest
}

StoreType is a structure used to return the configurable elements for the Store section of the global configuration file.

func (*StoreType) Validate

func (st *StoreType) Validate(name string) error

type StoreTypeTest

type StoreTypeTest struct {
	UseTestNamespace  bool
	UseUniqueInstance bool
	PreCleanStore     bool
}

StoreTypeTest describes the specific configured elements for a store test

type TracingType

type TracingType struct {
	RetentionLimit   int
	ShowInternalData bool
}

TracingType is the structure that holds the various configuration settings associated with tracing and trace handling.

func (*TracingType) Validate

func (tt *TracingType) Validate(name string) error

type WebServerType

type WebServerType struct {
	// Filesystem path to the static files and scripts
	RootFilePath string

	// Predefined starting account
	SystemAccount string

	// .. and that account's password
	SystemAccountPassword string

	SessionInactivity  int
	ActiveSessionLimit int

	// External http endpoint
	FE Endpoint

	// GPRC endpoint, used for internal notifications
	BE        Endpoint
	TraceFile string
}

WebServerType is a helper type that describes the web_server configuration settings

func (*WebServerType) Validate

func (ws *WebServerType) Validate(name string) error

Validate ensures that the frontend service configuration contains minimally legal values.

Jump to

Keyboard shortcuts

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