Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfig ¶
Create a new configuration from the default config json file. Return an error if the config cannot be read or parsed.
This will read two files:
- /etc/config/conf.json
- /etc/secrets/secrets.json
The values read from secrets.json will override the values in conf.json
func GetConfigOrDie ¶
func GetConfigOrDie[C any]() C
Create a new configuration from the default config json file.
This will read two files:
- /etc/config/conf.json
- /etc/secrets/secrets.json
The values read from secrets.json will override the values in conf.json
func UnmarshalParams ¶
func UnmarshalParams(p *v1alpha1.Parameters, into any) error
Unmarshal a list of parameters into a strongly typed struct.
The struct must have json tags that match the keys of the parameters. If the parameters cannot be unmarshaled into the struct, an error is returned.
Types ¶
type JsonOpts ¶
type JsonOpts[Options any] struct { // Options loaded from a json config using the Load method. Options Options }
Mixin that adds the ability to load options from a json map. Usage: type StructUsingOpts struct { conf.JsonOpts[MyOpts] }
type RawOpts ¶
type RawOpts struct {
// contains filtered or unexported fields
}
Raw options that are not directly unmarshalled when loading from json. Usage: call Unmarshal to unmarshal the options into a struct.
func NewRawOpts ¶
Create a new RawOpts instance with the given json string.
func NewRawOptsBytes ¶
func (*RawOpts) Unmarshal ¶
Call the postponed unmarshal function and unmarshal the options into a struct.
func (*RawOpts) UnmarshalJSON ¶
Override the default json unmarshal behavior to postpone the unmarshal.