Documentation ¶
Index ¶
- func ComputeFullPath(url string, r *http.Request) string
- func EnvOrDefault(name, def string) string
- func EnvOrDefaultBool(name string, def bool) bool
- func EnvOrDefaultInt32(name string, def int32) int32
- func EnvOrDefaultInt64(name string, def int64) int64
- func EnvOrDefaultStringSlice(name, separator string, def []string) []string
- func GetFunctionListeningPort() (port, cloud string, err error)
- func GetHttpRequestBaseUrl(r *http.Request) string
- func GetHttpRequestScheme(r *http.Request) string
- func InitTracerJaeger(jaegerEndpoint, serviceNameKey, serviceInstanceIDKey, tenant string) (*trace.TracerProvider, error)
- func InitTracerStdout() (*trace.TracerProvider, error)
- func RandomString(n int) string
- type HttpError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeFullPath ¶
ComputeFullPath will add the current canonical hostname to a URL, if it doesn't already contain the canonical hostname (i.e. it is only a path)
func EnvOrDefault ¶
EnvOrDefault returns the value of the environment variable identified by name parameter, or the value of the def parameter if the environment variable is missing.
Note: It will return an empty string if the environment variable is set to an empty string.
func EnvOrDefaultBool ¶
EnvOrDefaultBool returns the value of the environment variable identified by name parameter cast to a boolean, or the value of the def parameter if the environment variable is missing or empty.
Note: It will return the value of def if the environment variable is set to an empty string.
func EnvOrDefaultInt32 ¶
EnvOrDefaultInt32 returns the value of the environment variable identified by name parameter cast to a 32bit decimal integer, or the value of the def parameter if the environment variable is missing or empty.
Note: It will return the value of def if the environment variable is set to an empty string.
func EnvOrDefaultInt64 ¶
EnvOrDefaultInt64 returns the value of the environment variable identified by name parameter cast to a 64bit decimal integer, or the value of the def parameter if the environment variable is missing or empty.
Note: It will return the value of def if the environment variable is set to an empty string.
func EnvOrDefaultStringSlice ¶
EnvOrDefaultStringSlice returns the value of the environment variable identified by name parameter split by the value of the separator parameter as a slice of strings, or the value of the def parameter if the environment variable is missing.
Note: It will return an empty slice if the environment variable is set to an empty string.
func GetFunctionListeningPort ¶
GetFunctionListeningPort will return the port on which the function is listening to and the cloud it believes the function is running in, or an error. Currently only supports Azure Functions.
func GetHttpRequestBaseUrl ¶
GetHttpRequestBaseUrl returns a canonical hostname for the current request in the form of <scheme>://<host or ip>:<port>
func GetHttpRequestScheme ¶
GetHttpRequestScheme determines the protocol scheme used in the request call. Returns either "http" or "https", always lowercase
func InitTracerJaeger ¶
func InitTracerJaeger(jaegerEndpoint, serviceNameKey, serviceInstanceIDKey, tenant string) (*trace.TracerProvider, error)
func InitTracerStdout ¶
func InitTracerStdout() (*trace.TracerProvider, error)
func RandomString ¶
Types ¶
type HttpError ¶
HttpError defines the generic structure of an HTTP error response.
func (*HttpError) Error ¶
Error will return the string representation of the HttpError.Message and Err, omitting the former if it is not set.
func (*HttpError) ErrorAndStack ¶
ErrorAndStack will return both the output of Error and StackTrace in one call
func (*HttpError) StackTrace ¶
StackTrace will return a string representation of Err's stack trace