Documentation
¶
Index ¶
- func DefaultLogger(clioCfg Config) (logger.Logger, error)
- func VersionCommand(a Application, version Version) *cobra.Command
- type Application
- type BusConstructor
- type Config
- func (c Config) AddFlags(flags *pflag.FlagSet)
- func (c *Config) WithBusConstructor(constructor BusConstructor) *Config
- func (c *Config) WithConfigFinders(finders ...fangs.Finder) *Config
- func (c *Config) WithConfigs(cfg ...any) *Config
- func (c *Config) WithDevelopmentConfig(cfg DevelopmentConfig) *Config
- func (c *Config) WithInitializers(initializers ...Initializer) *Config
- func (c *Config) WithLoggerConstructor(constructor LoggerConstructor) *Config
- func (c *Config) WithLoggingConfig(cfg LoggingConfig) *Config
- func (c *Config) WithNoBus() *Config
- func (c *Config) WithNoLogging() *Config
- func (c *Config) WithUIConstructor(constructor UIConstructor) *Config
- type DevelopmentConfig
- type Initializer
- type LoggerConstructor
- type LoggingConfig
- type Profile
- type State
- type UI
- type UIConstructor
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VersionCommand ¶
func VersionCommand(a Application, version Version) *cobra.Command
Types ¶
type Application ¶
type Application interface {
Setup(cfgs ...any) func(cmd *cobra.Command, args []string) error
Run(ctx context.Context, errs <-chan error) error
State() State
Config() Config
}
func New ¶
func New(cfg Config) Application
type BusConstructor ¶
type Config ¶
type Config struct {
Name string
Version string
AdditionalConfigs []interface{}
Dev *DevelopmentConfig
Log *LoggingConfig
FangsConfig fangs.Config
ConfigFinders []fangs.Finder
BusConstructor BusConstructor
LoggerConstructor LoggerConstructor
UIConstructor UIConstructor
Initializers []Initializer
}
func (*Config) WithBusConstructor ¶
func (c *Config) WithBusConstructor(constructor BusConstructor) *Config
func (*Config) WithConfigFinders ¶
func (*Config) WithConfigs ¶
func (*Config) WithDevelopmentConfig ¶
func (c *Config) WithDevelopmentConfig(cfg DevelopmentConfig) *Config
func (*Config) WithInitializers ¶
func (c *Config) WithInitializers(initializers ...Initializer) *Config
func (*Config) WithLoggerConstructor ¶
func (c *Config) WithLoggerConstructor(constructor LoggerConstructor) *Config
func (*Config) WithLoggingConfig ¶
func (c *Config) WithLoggingConfig(cfg LoggingConfig) *Config
func (*Config) WithNoLogging ¶
func (*Config) WithUIConstructor ¶
func (c *Config) WithUIConstructor(constructor UIConstructor) *Config
type DevelopmentConfig ¶
type DevelopmentConfig struct {
Profile Profile `yaml:"profile" json:"profile"`
}
func (*DevelopmentConfig) PostLoad ¶
func (d *DevelopmentConfig) PostLoad() error
type Initializer ¶
type LoggingConfig ¶
type LoggingConfig struct {
Quiet bool `yaml:"quiet" json:"quiet"` // -q, indicates to not show any status output to stderr
Verbosity int `yaml:"-" json:"-" ` // -v or -vv , controlling which UI (ETUI vs logging) and what the log level should be
Level logger.Level `yaml:"level" json:"level"` // the log level string hint
FileLocation string `yaml:"file" json:"file"` // the file path to write logs to
// contains filtered or unexported fields
}
LoggingConfig contains all logging-related configuration options available to the user via the application config.
func (*LoggingConfig) AddFlags ¶
func (l *LoggingConfig) AddFlags(flags *pflag.FlagSet)
func (*LoggingConfig) PostLoad ¶
func (l *LoggingConfig) PostLoad() error
type UIConstructor ¶
type Version ¶
type Version struct {
Version string `json:"version,omitempty"` // application semantic version
GitCommit string `json:"gitCommit,omitempty"` // git SHA at build-time
GitDescription string `json:"gitDescription,omitempty"` // indication of git tree (either "clean" or "dirty") at build-time
BuildDate string `json:"buildDate,omitempty"` // date of the build
}
Version defines the application version details (generally from build information)
Click to show internal directories.
Click to hide internal directories.