Documentation ¶
Index ¶
- Constants
- Variables
- func AddRequestId(req *http.Request) string
- func AnyAccess(traffic string, start time.Time, duration time.Duration, req *http.Request, ...)
- func DisableDebugAccessHandler()
- func EgressAccess(start time.Time, duration time.Duration, req *http.Request, ...)
- func EnableDebugAccessHandler()
- func HttpHostMetricsHandler(appHandler http.Handler, msg string) http.Handler
- func IngressAccess(start time.Time, duration time.Duration, req *http.Request, ...)
- func InternalAccess(start time.Time, duration time.Duration, req *http.Request, ...)
- func Log(ctx any, method, uri string, statusCode func() int) func()
- func NewStatusCodeClosure(status **runtime.Status) func() int
- func SetAccessHandler(fn AccessHandler)
- func WrapBypass(handler runtime.DoHandler) runtime.DoHandler
- func WrapDo(handler runtime.DoHandler) runtime.DoHandler
- func WrapHttp(handler runtime.HttpHandler) runtime.HttpHandler
- func WrapPost(handler runtime.PostHandler) runtime.PostHandler
- type AccessHandler
- type Controller2
Constants ¶
View Source
const ( InternalTraffic = "internal" EgressTraffic = "egress" IngressTraffic = "ingress" )
Variables ¶
View Source
var (
PkgUri = reflect.TypeOf(any(pkg{})).PkgPath()
)
Functions ¶
func AddRequestId ¶
AddRequestId - function copied from package httpx
func AnyAccess ¶
func AnyAccess(traffic string, start time.Time, duration time.Duration, req *http.Request, resp *http.Response, threshold int, statusFlags string)
AnyAccess - needed for packages that have optional logging when core logging is not configured.
func DisableDebugAccessHandler ¶
func DisableDebugAccessHandler()
func EgressAccess ¶
func EnableDebugAccessHandler ¶
func EnableDebugAccessHandler()
func HttpHostMetricsHandler ¶
HttpHostMetricsHandler - handler for Http request metrics
func IngressAccess ¶
func InternalAccess ¶
func NewStatusCodeClosure ¶
func SetAccessHandler ¶
func SetAccessHandler(fn AccessHandler)
func WrapBypass ¶
WrapBypass - wrap a DoHandler with no logging
func WrapHttp ¶
func WrapHttp(handler runtime.HttpHandler) runtime.HttpHandler
WrapHttp - wrap a HttpHandler with access logging
func WrapPost ¶
func WrapPost(handler runtime.PostHandler) runtime.PostHandler
WrapPost - wrap a PostHandler with access logging
Types ¶
type AccessHandler ¶
type AccessHandler func(traffic string, start time.Time, duration time.Duration, req *http.Request, resp *http.Response, threshold int, statusFlags string)
AccessHandler - access logging handler
func GetAccessHandler ¶
func GetAccessHandler() AccessHandler
type Controller2 ¶
Controller2 - an interface that manages resiliency for a runtime.TypeHandlerFn
func NewController2 ¶
func NewController2(handler runtime.DoHandler) Controller2
NewController2 - create a new access logging controller
Click to show internal directories.
Click to hide internal directories.