decoder

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJson

func DecodeJson(r io.Reader, to any) error

func DecodeToml

func DecodeToml(r io.Reader, to any) error

func DecodeYaml

func DecodeYaml(r io.Reader, to any) error

Types

type Map

type Map struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Map

func (*Map) Decode

func (m *Map) Decode(input, output any) error

type Option

type Option func(*option)

func WithHooks

func WithHooks(hooks ...loader.HookFunc) Option

WithHooks sets the hooks for map to struct conversion.

func WithTag

func WithTag(tag string) Option

WithTag sets the tag for the configuration.

  • default is "cfg"

func WithWeaklyDashUnderscore

func WithWeaklyDashUnderscore(v bool) Option

WithWeaklyDashUnderscore sets the weakly dash underscore option.

  • default is true

func WithWeaklyIgnoreSeperator

func WithWeaklyIgnoreSeperator(v bool) Option

WithWeaklyIgnoreSeperator sets the weakly ignore separator option.

  • default is true

func WithWeaklyTypedInput added in v0.2.5

func WithWeaklyTypedInput(v bool) Option

WithWeaklyTypedInput sets the weakly typed input option.

  • default is true

Jump to

Keyboard shortcuts

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