Documentation
¶
Overview ¶
Package common contains common utilities and functions used by the service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "dev" ShellToUse = GetEnv("SHELL_TO_USE", "/bin/ash") )
Functions ¶
func GetEnv ¶ added in v0.5.0
GetEnv returns the value of the environment variable named by key, or defaultValue if the environment variable doesn't exist
func GetEnvInt ¶
GetEnvInt returns the value of the environment variable named by key, or defaultValue if the environment variable doesn't exist or is not a valid integer
func SetupLogger ¶
func SetupLogger(opts *LoggingOpts) (log *httplog.Logger)
Types ¶
type LoggingOpts ¶
type LoggingOpts struct {
ServiceName string
// Whether to log in JSON format
JSON bool
// Whether to log debug messages
Debug bool
// Concise mode includes fewer log details during the request flow. For example excluding details like
// request content length, user-agent and other details. This is useful if during development your console is too noisy.
Concise bool
// RequestHeaders enables logging of all request headers, however sensitive headers like authorization, cookie and set-cookie are hidden.
RequestHeaders bool
// Tags are additional fields included at the root level of all logs. These can be useful for example the commit hash of a build, or an environment name like prod/stg/dev
Tags map[string]string
}
Click to show internal directories.
Click to hide internal directories.