internal

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(value any, name string) (bool, bool, error)

func BoolFromString

func BoolFromString(value string) (bool, error)

func CanReflectValueBeNil added in v2.2.2

func CanReflectValueBeNil(value reflect.Value) bool

func CopyAnyMap added in v2.8.1

func CopyAnyMap(source map[string]any) map[string]any

func CopyAnySlice added in v2.8.1

func CopyAnySlice(source []any) []any

func CopyAnyValue added in v2.13.0

func CopyAnyValue(value any) any
CopyAnyValue copies one value at the same depth CopyAnyMap copies a whole map: maps and slices

are descended into, everything else — a pointer, a struct, a channel — is returned as-is, which is the documented boundary of what a copied container may safely carry.

func CopyStringMap

func CopyStringMap[T any](input map[string]T) map[string]T

func Duration

func Duration(value any, name string) (time.Duration, bool, error)

func EscapeControlCharacters added in v2.13.0

func EscapeControlCharacters(value string) string

EscapeControlCharacters replaces every C0 control character and DEL in the value with its visible escape spelling — the named ones as \n, \r, \t, the rest as \xNN — so text of unknown origin can be written to a terminal or a line-oriented log without repainting the one or forging records in the other. An embedded escape sequence stays data: the ESC byte that would start it is rendered as \x1b, and an embedded line break is rendered as \n instead of ending the record it belongs to.

func EscapeControlCharactersKeepingNewlines added in v2.13.0

func EscapeControlCharactersKeepingNewlines(value string) string

EscapeControlCharactersKeepingNewlines is the cell form of EscapeControlCharacters: a newline stays a real line break, because the consumer renders multi-line values on purpose, and every other control character is escaped the same way.

func Float64

func Float64(value any, name string) (float64, bool, error)

func Int

func Int(value any, name string) (int64, bool, error)

func IsNilInterface

func IsNilInterface(value any) bool

func MapStringString

func MapStringString(value any, name string) (map[string]string, bool, error)

func NewEventListenerContext

func NewEventListenerContext(
	eventName string,
	eventType string,
	listenerName string,
	listenerType string,
	listenerPriority int,
	durationMs int64,
) loggingcontract.Context

func NewEventListenerPanicContext

func NewEventListenerPanicContext(
	baseContext loggingcontract.Context,
	panicValue any,
	panicType string,
	panicStack string,
) loggingcontract.Context

func ParseError

func ParseError(
	parameterName string,
	expectedType string,
	value any,
	causeErr error,
) *exception.Error

func ParseQualityValue added in v2.13.0

func ParseQualityValue(value string) (float64, bool)

ParseQualityValue validates value against the qvalue grammar of RFC 7231 — a zero with up to three decimal digits, or a one with up to three zero decimals — and reports anything outside it as invalid instead of guessing a weight for it. It is the one reader for every q parameter the framework negotiates on: a bare float parse accepts NaN, infinities and out-of-range numbers, so the same malformed header could open, close or silently poison a negotiation depending on which reader saw it.

func SplitOutsideQuotes added in v2.13.0

func SplitOutsideQuotes(value string, separator byte) []string

SplitOutsideQuotes splits value on separator while honouring quoted-string sections: a separator inside double quotes belongs to the parameter value it sits in, and a backslash escapes the character after it inside a quoted section, so a media range such as text/plain;version="1,2";q=0 stays one member instead of losing the refusal it carries. It is the one member and parameter splitter for every negotiating reader in this tree: a bare strings.Split cuts through quoted parameter values, so the same header could keep a refusal for one reader and lose it for another. It cuts at most maximumSplitOutsideQuotesMembers members; the remainder past the cap stays the final member.

func StringifyType

func StringifyType(value any) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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