Documentation ¶
Index ¶
- Constants
- Variables
- func AddConfigFileFlag(cmd *cobra.Command, f *ConfigFileFlags, p ConfigFileParams)
- func AddConfigFilePathsFlag(cmd *cobra.Command, f *ConfigFileFlags, p ConfigFileParams)
- func AddLogFormatFlag(cmd *cobra.Command, f *LogFlags, p LogParams)
- func AddLogLevelFlag(cmd *cobra.Command, f *LogFlags, p LogParams)
- func AddTuiInteractiveFlag(cmd *cobra.Command, f *TuiFlags, p TuiParams)
- func ParseLogLevel(level string) (slog.Level, bool)
- func RegisterConfiguration(name string, filename string, searchPaths []string) error
- func RegisterEnvironment(name string, prefix string, keys []string) error
- type Application
- type BoolSliceVar
- type BoolVar
- type Command
- type Commander
- type ConfigFileFlags
- type ConfigFileParams
- type Configuration
- func (c *Configuration) EnvExists(name string) bool
- func (c *Configuration) FileExists(name string) bool
- func (c *Configuration) GetEnv(name string) (*viper.Viper, error)
- func (c *Configuration) GetFile(name string) (*viper.Viper, error)
- func (c *Configuration) SetEnvironment(name string, v *viper.Viper) error
- func (c *Configuration) SetFile(name string, v *viper.Viper) error
- type EnvConfiguration
- type EnvConfigurationAlreadyLoadedError
- type EnvConfigurationIsEmptyError
- type EnvConfigurationNotLoadedError
- type FileConfiguration
- type FileConfigurationExistsError
- type FileConfigurationNotFoundError
- type LogFlags
- type LogFormat
- type LogParams
- type StringSliceVar
- type StringVar
- type TuiFlags
- type TuiParams
- type Version
Constants ¶
View Source
const ( ErrEnvConfigurationAlreadyLoadedMessage = " environment is already loaded" ErrEnvConfigurationIsEmptyMessage = "environment configuration does not define keys" ErrEnvConfigurationNotLoadedMessage = "environment not loaded" ErrFileConfigurationExistsMessage = "configuration exists" ErrFileConfigurationNotFoundMessage = "configuration not found" )
Variables ¶
View Source
var ( ErrEnvConfigurationAlreadyLoaded = EnvConfigurationAlreadyLoadedError{/* contains filtered or unexported fields */} ErrEnvConfigurationIsEmpty = EnvConfigurationIsEmptyError{/* contains filtered or unexported fields */} ErrEnvConfigurationNotLoaded = EnvConfigurationNotLoadedError{/* contains filtered or unexported fields */} ErrFileConfigurationExists = FileConfigurationExistsError{/* contains filtered or unexported fields */} ErrFileConfigurationNotFound = FileConfigurationNotFoundError{/* contains filtered or unexported fields */} )
Functions ¶
func AddConfigFileFlag ¶
func AddConfigFileFlag(cmd *cobra.Command, f *ConfigFileFlags, p ConfigFileParams)
func AddConfigFilePathsFlag ¶
func AddConfigFilePathsFlag(cmd *cobra.Command, f *ConfigFileFlags, p ConfigFileParams)
func AddTuiInteractiveFlag ¶
func RegisterConfiguration ¶
Types ¶
type Application ¶
func NewApplication ¶
func NewApplication(c *cobra.Command, v Version) *Application
func (*Application) RegisterCommands ¶
func (a *Application) RegisterCommands(c []Commander, f func(cmd *cobra.Command))
func (*Application) Run ¶
func (a *Application) Run() error
type BoolSliceVar ¶
type Command ¶
type ConfigFileFlags ¶
type ConfigFileParams ¶
type ConfigFileParams struct { File StringVar Paths StringSliceVar }
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
var Config *Configuration
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) EnvExists ¶
func (c *Configuration) EnvExists(name string) bool
func (*Configuration) FileExists ¶
func (c *Configuration) FileExists(name string) bool
func (*Configuration) SetEnvironment ¶
func (c *Configuration) SetEnvironment(name string, v *viper.Viper) error
type EnvConfiguration ¶
type EnvConfiguration struct {
// contains filtered or unexported fields
}
func NewEnvConfiguration ¶
func NewEnvConfiguration(prefix string, keys []string) (EnvConfiguration, error)
func (EnvConfiguration) HasKeys ¶
func (e EnvConfiguration) HasKeys() bool
func (EnvConfiguration) Keys ¶
func (e EnvConfiguration) Keys() []string
func (EnvConfiguration) Prefix ¶
func (e EnvConfiguration) Prefix() string
type EnvConfigurationAlreadyLoadedError ¶
type EnvConfigurationAlreadyLoadedError struct {
// contains filtered or unexported fields
}
func (EnvConfigurationAlreadyLoadedError) Error ¶
func (e EnvConfigurationAlreadyLoadedError) Error() string
type EnvConfigurationIsEmptyError ¶
type EnvConfigurationIsEmptyError struct {
// contains filtered or unexported fields
}
func (EnvConfigurationIsEmptyError) Error ¶
func (e EnvConfigurationIsEmptyError) Error() string
type EnvConfigurationNotLoadedError ¶
type EnvConfigurationNotLoadedError struct {
// contains filtered or unexported fields
}
func (EnvConfigurationNotLoadedError) Error ¶
func (e EnvConfigurationNotLoadedError) Error() string
type FileConfiguration ¶
type FileConfiguration struct {
// contains filtered or unexported fields
}
func NewFileConfiguration ¶
func NewFileConfiguration(file string, searchPaths []string) FileConfiguration
type FileConfigurationExistsError ¶
type FileConfigurationExistsError struct {
// contains filtered or unexported fields
}
func (FileConfigurationExistsError) Error ¶
func (e FileConfigurationExistsError) Error() string
type FileConfigurationNotFoundError ¶
type FileConfigurationNotFoundError struct {
// contains filtered or unexported fields
}
func (FileConfigurationNotFoundError) Error ¶
func (e FileConfigurationNotFoundError) Error() string
type StringSliceVar ¶
Click to show internal directories.
Click to hide internal directories.