Documentation
¶
Overview ¶
Package appcontext implements the app context. The context includes various utilities such as the logger used through the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is the application context that carries a context.Context and some other utilities to be used across the application.
Implements context.Context.
func Background ¶
func Background() *Context
Background returns an empty context with default logrus logger.
func BackgroundDebug ¶
func BackgroundDebug() *Context
BackgroundDebug is same as Background with Debug returning true.
func WithCancel ¶
WithCancel creates a Context from context.Context with a cancel function.
func WithSignals ¶
WithSignals creates a context that cancels on receiving the os.Signal.
func (*Context) Deadline ¶
Deadline returns the time when work done on behalf of this context should be canceled.
func (*Context) Debug ¶
Debug tells if the application is running in debugging mode or not. This is set by setting the `DEBUG` environment variable to "on".
func (*Context) Done ¶
func (c *Context) Done() <-chan struct{}
Done returns a channel that's closed when work done on behalf of this context should be canceled.