Documentation ¶
Index ¶
- Constants
- func BuildInfo() (revision string, at time.Time, isModified, ok bool)
- func Context() context.Context
- func Env() string
- func OnSignal(ctx context.Context, sig os.Signal, fn func(ctx context.Context))
- func SelfSignal(sig os.Signal) error
- func SetEnv(env, def string) string
- func Uptime() time.Duration
Constants ¶
View Source
const IsDebugBuild = false
IsDebugBuild reports whether compilation was with `-tags=debug` flag.
Variables ¶
This section is empty.
Functions ¶
func Env ¶ added in v0.4.0
func Env() string
Env where application is running. Can be set via SetEnv func.
func OnSignal ¶ added in v0.5.0
OnSignal run fn. Function is async, context is used to close underlying goroutine.
func SelfSignal ¶ added in v0.5.0
SelfSignal sends signal to the current process.
func SetEnv ¶ added in v0.4.0
SetEnv for the application from environment variable or a default. Can be called once, all next calls panics. Example:
appx.SetEnv("ENV", "dev") // set from ENV or set default "dev" appx.SetEnv("ENV", "") // set from ENV or leave unset appx.SetEnv("", "dev") // set "dev" directly
This function should be called at the start of the application.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.