Documentation
¶
Index ¶
- Constants
- Variables
- func AfterInit(f func())
- func BeforeInit(f func())
- func Debug()
- func Init(opts ...Option)
- func IsValidRemotePrefix(s string) bool
- func OnInit(f func())
- func Register(mod ConfigInterface)
- func SetAppSecret(s string)
- type ConfigInterface
- type Option
- func AppName(s string) Option
- func AppSecret(s string) Option
- func ColorMode(b bool) Option
- func ConfigEnvironName(s string) Option
- func ConfigFileAbsolutePath(s string) Option
- func ConfigFileBaseName(s string) Option
- func ConfigFileType(s string) Option
- func ConfigRemotePath(s string) Option
- func ConfigSearchPaths(s []string) Option
- func ConfigString(s string) Option
- func DebugMode(b bool) Option
- func VerboseMode(b bool) Option
- type Options
- type VersionInfo
Constants ¶
View Source
const (
DefaultAppDescription = ""
)
DefaultAppDescription ...
Variables ¶
View Source
var ( DefaultAppName = "rai" DefaultAppSecret string DefaultAppColor = !color.NoColor IsDebug bool IsVerbose bool App = &appConfig{ Name: DefaultAppName, Description: DefaultAppDescription, Version: VersionInfo{ Version: "0.2.0", BuildDate: time.Now().String(), GitCommit: "-dirty-", GitBranch: "-dirty-", GitState: "-dirty-", GitSummary: "-dirty-", }, done: make(chan struct{}), } )
DefaultAppName ...
Functions ¶
func IsValidRemotePrefix ¶
Types ¶
type ConfigInterface ¶
type ConfigInterface interface {
ConfigName() string
SetDefaults()
Read()
Wait()
String() string
Debug()
}
ConfigInterface ...
type Option ¶
type Option func(*Options)
Option ...
func ConfigFileAbsolutePath ¶
ConfigFileAbsolutePath ...
type Options ¶
type Options struct {
AppName string
AppSecret string
ConfigSearchPaths []string
ConfigEnvironName string
ConfigFileBaseName string
ConfigFileType string
ConfigFileAbsolutePath string
ConfigString *string
ConfigRemotePath string
IsVerbose bool
IsDebug bool
}
Options ...
type VersionInfo ¶
type VersionInfo struct {
// Version is populated at compile time by govvv from ./VERSION
Version string
// GitCommit is populated at compile time by govvv.
BuildDate string
// GitState is populated at compile time by govvv.
GitCommit string
GitBranch string
GitState string
GitSummary string
}
VersionInfo ...
Click to show internal directories.
Click to hide internal directories.