helpers

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAdditionalLogs

func GetAdditionalLogs(resp interface{}) map[string]interface{}

GetAdditionalLogs

If a response implements response.ExtendedLog, then this function will retrieve the attached logs and return.

func GetCtxHeadersFromContext

func GetCtxHeadersFromContext(ctx context.Context) map[string]interface{}

GetCtxHeadersFromContext

Retrieve the saved headers from the request context. Returns nil if not found.

func GetFriendlyRequestName

func GetFriendlyRequestName(req interface{}) string

GetFriendlyRequestName

Gets the friendly request name of an object. If the object does not implement a known type, this function will use reflection to get the objects type name.

func GetRequestBodyLimit

func GetRequestBodyLimit(ctx context.Context) *int

GetRequestBodyLimit

Gets the request body size limit that was assigned. If this value is not present, the result will be nil.

func InjectCtxHeaders

func InjectCtxHeaders(ctx *context.Context, headers map[string]interface{})

InjectCtxHeaders

Inject the given context with the given headers. No-op if context is nil.

func MixinCtxHeaders

func MixinCtxHeaders(ctx context.Context, headers map[string]interface{}) context.Context

MixinCtxHeaders

Similar in function to InjectCtxHeaders, except this will use the WithValue pattern and return a wrapped context.Context value.

func SetRequestBodyLimit added in v1.2.1

func SetRequestBodyLimit(ctx *context.Context, limit int)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL