Documentation ¶
Index ¶
- func Context(ctx context.Context, cfg Config) context.Context
- type Config
- type IniConfig
- func (c *IniConfig) ExportEnv(ctx context.Context) error
- func (c *IniConfig) GetValue(section, key string) (string, bool)
- func (c *IniConfig) Save(ctx context.Context) error
- func (c *IniConfig) SetValue(section, key, value string)
- func (c *IniConfig) UnsetValue(section, key string)
- func (c *IniConfig) Values() map[string]map[string]string
- type Mock
- func (m *Mock) ExportEnv(_ context.Context) error
- func (m *Mock) GetValue(section string, key string) (string, bool)
- func (m *Mock) Save(_ context.Context) error
- func (m *Mock) SetValue(section string, key string, value string)
- func (m *Mock) UnsetValue(section string, key string)
- func (m *Mock) Values() map[string]map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config interface { Save(context.Context) error Values() map[string]map[string]string GetValue(string, string) (string, bool) SetValue(string, string, string) UnsetValue(string, string) ExportEnv(context.Context) error }
Config contains methods to operate on CLI config
type IniConfig ¶
type IniConfig struct {
// contains filtered or unexported fields
}
IniConfig represents a config stored in ini file
func NewIni ¶
NewIni finds an existing ini file with config or creates new one and returns IniConfig
func (*IniConfig) ExportEnv ¶
ExportEnv exports values from config file as environmental variables, prefixing each with AKAMAI_<SECTION_NAME> It also attempts migration from previous config versions
func (*IniConfig) UnsetValue ¶
UnsetValue unsets a key in provided section
Click to show internal directories.
Click to hide internal directories.