Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyToConfigSet(configPath string, cs ConfigurationSet) error
- func ApplyToConfigSetWithProvider(configPath string, cs ConfigurationSet, provider string) error
- func GetValue(name string, provider string) (string, error)
- func Unmarshall(cs ConfigurationSet, out interface{}) error
- type AppConfiguration
- type ConfigurationSet
- type Item
- type ItemType
Constants ¶
View Source
const (
// ListPrefix is the prefix for a list name
ListPrefix = "$"
)
Variables ¶
View Source
var ( ErrConfigExistsAlready = errors.New("config item with same name already exists in set") ErrConfigNotFound = errors.New("configuration item not found") ErrUnknownItemType = errors.New("unknown item type for config item") )
View Source
var ( ItemTypeString = ItemType("string") ItemTypeInt = ItemType("int") ItemTypeBool = ItemType("bool") )
View Source
var (
ErrListNotFound = errors.New("list not found")
)
Functions ¶
func ApplyToConfigSet ¶
func ApplyToConfigSet(configPath string, cs ConfigurationSet) error
ApplyToConfigSet will apply the saved app configuration to the supplied config set.
func ApplyToConfigSetWithProvider ¶
func ApplyToConfigSetWithProvider(configPath string, cs ConfigurationSet, provider string) error
ApplyToConfigSetWithProvider will apply the saved app configuration to the supplied config set and will take into consideration provider specific overrides
func Unmarshall ¶
func Unmarshall(cs ConfigurationSet, out interface{}) error
Unmarshall will unmarshall the ConfigurationSet into a struct
Types ¶
type AppConfiguration ¶
type AppConfiguration interface { Get() (*kconnectv1alpha.Configuration, error) Save(configuration *kconnectv1alpha.Configuration) error Parse(reader io.Reader) (*kconnectv1alpha.Configuration, error) }
func NewAppConfiguration ¶
func NewAppConfiguration() (AppConfiguration, error)
func NewAppConfigurationWithPath ¶
func NewAppConfigurationWithPath(path string) (AppConfiguration, error)
type ConfigurationSet ¶
type ConfigurationSet interface { Get(name string) *Item GetAll() []*Item Exists(name string) bool ExistsWithValue(name string) bool ValueIsList(name string) bool ValueString(name string) string Add(item *Item) error AddSet(set ConfigurationSet) error SetSensitive(name string) error SetHistoryIgnore(name string) error SetRequired(name string) error SetHidden(name string) error SetDeprecated(name string, message string) error SetValue(name string, value interface{}) error SetShort(name string, shorthand string) error String(name string, defaultValue string, description string) (*Item, error) Int(name string, defaultValue int, description string) (*Item, error) Bool(name string, defaultValue bool, description string) (*Item, error) }
func NewConfigurationSet ¶
func NewConfigurationSet() ConfigurationSet
Click to show internal directories.
Click to hide internal directories.