conversion

package
v0.0.0-...-525259f Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToPointerHook

func AnyToPointerHook() mapstructure.DecodeHookFunc

AnyToPointerHook handles conversion to pointer types.

func DefaultDecodeHook

func DefaultDecodeHook() mapstructure.DecodeHookFunc

DefaultDecodeHook returns the default DecodeHook with support for: - time.Duration (via mapstructure built-in) - []string from comma-separated strings (via mapstructure built-in) - time.Time from RFC3339 strings - url.URL from strings - net.IP from strings - encoding.TextUnmarshaler types - Pointer types.

func DefaultDecodeHookWithTimeFormats

func DefaultDecodeHookWithTimeFormats(formats ...string) mapstructure.DecodeHookFunc

DefaultDecodeHookWithTimeFormats returns a DecodeHook with custom time formats. Formats are tried in order until one succeeds.

func StringToIPHook

func StringToIPHook() mapstructure.DecodeHookFunc

StringToIPHook converts string to net.IP.

func StringToTextUnmarshalerHook

func StringToTextUnmarshalerHook() mapstructure.DecodeHookFunc

StringToTextUnmarshalerHook converts string to any type implementing encoding.TextUnmarshaler.

func StringToTimeHook

func StringToTimeHook() mapstructure.DecodeHookFunc

StringToTimeHook converts string to time.Time using RFC3339 format.

func StringToTimeHookWithFormats

func StringToTimeHookWithFormats(formats ...string) mapstructure.DecodeHookFunc

StringToTimeHookWithFormats converts string to time.Time using multiple formats. Formats are tried in order until one succeeds.

func StringToURLHook

func StringToURLHook() mapstructure.DecodeHookFunc

StringToURLHook converts string to url.URL.

Types

This section is empty.

Jump to

Keyboard shortcuts

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