Documentation
¶
Index ¶
- func Bool(value any, name string) (bool, bool, error)
- func BoolFromString(value string) (bool, error)
- func CanReflectValueBeNil(value reflect.Value) bool
- func CopyAnyMap(source map[string]any) map[string]any
- func CopyAnySlice(source []any) []any
- func CopyAnyValue(value any) any
- func CopyStringMap[T any](input map[string]T) map[string]T
- func Duration(value any, name string) (time.Duration, bool, error)
- func EscapeControlCharacters(value string) string
- func EscapeControlCharactersKeepingNewlines(value string) string
- func Float64(value any, name string) (float64, bool, error)
- func Int(value any, name string) (int64, bool, error)
- func IsNilInterface(value any) bool
- func MapStringString(value any, name string) (map[string]string, bool, error)
- func NewEventListenerContext(eventName string, eventType string, listenerName string, listenerType string, ...) loggingcontract.Context
- func NewEventListenerPanicContext(baseContext loggingcontract.Context, panicValue any, panicType string, ...) loggingcontract.Context
- func ParseError(parameterName string, expectedType string, value any, causeErr error) *exception.Error
- func ParseQualityValue(value string) (float64, bool)
- func SplitOutsideQuotes(value string, separator byte) []string
- func StringifyType(value any) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolFromString ¶
func CanReflectValueBeNil ¶ added in v2.2.2
func CopyAnySlice ¶ added in v2.8.1
func CopyAnyValue ¶ added in v2.13.0
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 EscapeControlCharacters ¶ added in v2.13.0
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
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 IsNilInterface ¶
func MapStringString ¶
func NewEventListenerContext ¶
func NewEventListenerPanicContext ¶
func NewEventListenerPanicContext( baseContext loggingcontract.Context, panicValue any, panicType string, panicStack string, ) loggingcontract.Context
func ParseError ¶
func ParseQualityValue ¶ added in v2.13.0
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
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 ¶
Types ¶
This section is empty.