decoder

package
v0.1.72 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build[T any](item T, extraHooks ...mapstructure.DecodeHookFunc) (*mapstructure.Decoder, error)

func Decode

func Decode(dst any, src any) error

func DecodeHookFunc

func DecodeHookFunc() mapstructure.DecodeHookFunc

func DecodeWithTemplate added in v0.1.42

func DecodeWithTemplate(dst any, src any, data any) error

func GetHooks

func GetHooks() []mapstructure.DecodeHookFunc

func UsingParserOf

func UsingParserOf[T any](from any) (*T, error)

func UsingParserOfStrict

func UsingParserOfStrict[T any](from any) (T, error)

Types

type Decodable

type Decodable interface {
	Decode(reflect.Type, interface{}) (any, error)
}

func Of

func Of(from any) (Decodable, error)

type Parsable

type Parsable[T any] interface {
	Parse(val interface{}) (T, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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