Documentation ¶
Index ¶
- func Alarm() *alarm.Alarm
- func Cookie() http.Cookie
- func DeployName() string
- func Dir() string
- func Env() *config.Environment
- func ExternalURL() *url.URL
- func ExternalURLIsHTTPS() bool
- func FilePath(env *config.Environment) string
- func Get(key string) strmap.StrMap
- func GetDBConfig(typ, key string) interface{}
- func GetSlice(key string) []strmap.StrMap
- func GetString(key string) string
- func GetStringSlice(key string) []string
- func HttpLogger() *logger.Logger
- func Keepers() []string
- func Logger() *logger.Logger
- func Mailer() *email.Client
- func Name() string
- func NewLogger(paths ...string) *logger.Logger
- func NewLoggerFromWriter(writer io.Writer) *logger.Logger
- func Protect(fn func())
- func Root() string
- func Secret() string
- func TimeZone() *time.Location
- func TimestampSign(timestamp int64) string
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeployName ¶
func DeployName() string
func Env ¶
func Env() *config.Environment
func ExternalURL ¶
Example ¶
fmt.Println(ExternalURL().String())
Output: https://example.com/home
func ExternalURLIsHTTPS ¶
func ExternalURLIsHTTPS() bool
func FilePath ¶
func FilePath(env *config.Environment) string
func GetDBConfig ¶
func GetDBConfig(typ, key string) interface{}
func GetStringSlice ¶
func HttpLogger ¶
func Root ¶
func Root() string
Example ¶
root := Root() fmt.Println(strings.HasSuffix(root, "/config/release/img-app"))
Output: true
func TimestampSign ¶
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
The parent config package get root dir when init, it panics if no root is found.
|
The parent config package get root dir when init, it panics if no root is found. |
db
|
|
this package must be imported first, to ensure it is initialized before all the other package.
|
this package must be imported first, to ensure it is initialized before all the other package. |
Click to show internal directories.
Click to hide internal directories.