config

package
v0.0.1-dev2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceConfig

type ServiceConfig struct {
	SimpleCustom SimpleCustomConfig
}

Example structured custom configuration types. Must be wrapped with an outer struct with single element that matches the top level custom configuration element in your configuration.toml file, 'SimpleCustom' in this example.

func (*ServiceConfig) UpdateFromRaw

func (sw *ServiceConfig) UpdateFromRaw(rawConfig interface{}) bool

UpdateFromRaw updates the service's full configuration from raw data received from the Service Provider.

type SimpleCustomConfig

type SimpleCustomConfig struct {
	OffImageLocation string
	OnImageLocation  string
	Writable         SimpleWritable
}

SimpleCustomConfig is example of service's custom structured configuration that is specified in the service's configuration.toml file and Configuration Provider (aka Consul), if enabled.

func (*SimpleCustomConfig) Validate

func (scc *SimpleCustomConfig) Validate() error

Validate ensures your custom configuration has proper values. Example of validating the sample custom configuration

type SimpleWritable

type SimpleWritable struct {
	DiscoverSleepDurationSecs int64
}

SimpleWritable defines the service's custom configuration writable section, i.e. can be updated from Consul

Jump to

Keyboard shortcuts

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