Documentation ¶
Index ¶
Constants ¶
View Source
const ( ConfigFlagName = "config" LevelFlagName = "level" AppName = "hydros" ConfigDir = "." + AppName WorkDirFlagName = "work-dir" AppIDFlagName = "appId" PrivateKeyFlagName = "private-key" )
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigFile ¶
func DefaultConfigFile() string
Types ¶
type Config ¶
type Config struct { APIVersion string `json:"apiVersion" yaml:"apiVersion" yamltags:"required"` Kind string `json:"kind" yaml:"kind" yamltags:"required"` Logging *Logging `json:"logging,omitempty" yaml:"logging,omitempty"` GitHub *GitHubConfig `json:"gitHub,omitempty" yaml:"gitHub,omitempty"` // WorkDir is the working directory for hydros where repositories should be checked out WorkDir string `json:"workDir,omitempty" yaml:"workDir,omitempty"` }
Config represents the persistent configuration data for foyle.
Currently, the format of the data on disk and in memory is identical. In the future, we may modify this to simplify changes to the disk format and to store in-memory values that should not be written to disk.
func GetConfig ¶
func GetConfig() *Config
GetConfig returns a configuration created from the viper configuration.
func (*Config) GetConfigDir ¶
GetConfigDir returns the configuration directory
func (*Config) GetLogLevel ¶
func (*Config) GetWorkDir ¶
type GitHubConfig ¶
type LogSink ¶ added in v0.0.8
type LogSink struct { // Set to true to write logs in JSON format JSON bool `json:"json,omitempty" yaml:"json,omitempty"` // Path is the path to write logs to. Use "stderr" to write to stderr. // Use gcplogs:///projects/${PROJECT}/logs/${LOGNAME} to write to Google Cloud Logging Path string `json:"path,omitempty" yaml:"path,omitempty"` }
type Logging ¶
type Logging struct { Level string `json:"level,omitempty" yaml:"level,omitempty"` // Sinks is a list of sinks to write logs to. // Use stderr to write to stderr. // Use gcplogs:///projects/${PROJECT}/logs/${LOGNAME} to write to Google Cloud Logging Sinks []LogSink `json:"sinks,omitempty" yaml:"sinks,omitempty"` }
Logging configures the logging.
Click to show internal directories.
Click to hide internal directories.