Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteDefaultConfig ¶
WriteDefaultConfig writes a default configuration file to the specified path
Types ¶
type Config ¶
type Config struct {
Logging struct {
Level string `mapstructure:"level" yaml:"level"`
Format string `mapstructure:"format" yaml:"format"`
Debug bool `mapstructure:"debug" yaml:"debug"`
Directory string `mapstructure:"directory" yaml:"directory"`
Filename string `mapstructure:"filename" yaml:"filename"`
} `mapstructure:"logging" yaml:"logging"`
Server struct {
SpecsDir string `mapstructure:"specs_dir" yaml:"specs_dir"`
} `mapstructure:"server" yaml:"server"`
GitHub struct {
Token string `mapstructure:"token" yaml:"token"`
} `mapstructure:"github" yaml:"github"`
Specs []string `mapstructure:"specs" yaml:"specs"`
Path string `yaml:"-"` // Not saved to YAML, just for reference
}
Config represents the application configuration
func LoadConfig ¶
func LoadConfig(configFile string, logger LoggerInterface, verbose bool) (*Config, error)
LoadConfig loads configuration from a file
func (*Config) GetGitHubToken ¶
GetGitHubToken returns the GitHub API token
func (*Config) RemoveSpec ¶
RemoveSpec removes a spec from the config
func (*Config) ShouldUpdateConfig ¶
ShouldUpdateConfig returns true if the config file should be updated
type LoggerInterface ¶
type LoggerInterface interface {
Debugw(msg string, keysAndValues ...interface{})
Infow(msg string, keysAndValues ...interface{})
Warnw(msg string, keysAndValues ...interface{})
Errorw(msg string, keysAndValues ...interface{})
Fatalw(msg string, keysAndValues ...interface{})
}
LoggerInterface defines the required logging methods
Click to show internal directories.
Click to hide internal directories.