Documentation ¶
Index ¶
Constants ¶
View Source
const ApplicationName = "stepwise"
ApplicationName name of the appmication
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "stepwise", Short: "Starts the stepwise application.", Long: `Starts the stepwise application. If the application configuration file is not specified explicitly then it is searched for in the following locations: 1. /etc/stepwise/stepwise.toml 2. $HOME/.stepwise/stepwise.toml 3. ./stepwise.toml`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if cfgFile != "" { viper.SetConfigFile(cfgFile) } else { viper.SetConfigName(ApplicationName) viper.AddConfigPath(fmt.Sprintf("/etc/%s", ApplicationName)) viper.AddConfigPath(fmt.Sprintf("$HOME/.%s", ApplicationName)) viper.AddConfigPath(".") } viper.SetDefault("server.cert-cache-dir", "/var/www/.cache") viper.SetDefault("server.address", ":443") viper.SetDefault("users.default-results-per-page", "20") viper.SetDefault("logging.level", logging.InfoLogLevel) viper.SetDefault("logging.format", logging.TextLoggingFormat) viper.SetDefault("logging.log-requests", false) viper.AutomaticEnv() err := viper.ReadInConfig() if err != nil { return fmt.Errorf("Unable to load config file: %s", err) } return nil }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
type AutoTLSConfig ¶
type ServerConfig ¶
type ServerConfig struct { Address string `mapstructure:"address"` AutoTLS *AutoTLSConfig `mapstructure:"auto-tls"` TLS *TLSConfig `mapstructure:"tls"` }
Click to show internal directories.
Click to hide internal directories.