config

package
v0.0.0-...-d31700d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alarm

func Alarm() *alarm.Alarm
func Cookie() http.Cookie

func DeployName

func DeployName() string

func Dir

func Dir() string

func Env

func Env() *config.Environment

func ExternalURL

func ExternalURL() *url.URL
Example
fmt.Println(ExternalURL().String())
Output:

https://example.com/home

func ExternalURLIsHTTPS

func ExternalURLIsHTTPS() bool

func FilePath

func FilePath(env *config.Environment) string

func Get

func Get(key string) strmap.StrMap

func GetDBConfig

func GetDBConfig(typ, key string) interface{}

func GetSlice

func GetSlice(key string) []strmap.StrMap

func GetString

func GetString(key string) string

func GetStringSlice

func GetStringSlice(key string) []string

func HttpLogger

func HttpLogger() *logger.Logger

func Keepers

func Keepers() []string

func Logger

func Logger() *logger.Logger

func Mailer

func Mailer() *email.Client

func Name

func Name() string

func NewLogger

func NewLogger(paths ...string) *logger.Logger

func NewLoggerFromWriter

func NewLoggerFromWriter(writer io.Writer) *logger.Logger

func Protect

func Protect(fn func())

func Root

func Root() string
Example
root := Root()
fmt.Println(strings.HasSuffix(root, "/config/release/img-app"))
Output:

true

func Secret

func Secret() string

func TimeZone

func TimeZone() *time.Location

func TimestampSign

func TimestampSign(timestamp int64) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL