configor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(dst any, payload ...[]byte) error

Load will unmarshal configurations to struct from files that you provide

func LoadFile

func LoadFile(dst any, files ...string) error

Load will unmarshal configurations to struct from files that you provide

func Register

func Register(suffix string, f func([]byte, any) error)

func Unmarshalers

func Unmarshalers() []string

Types

type Configor

type Configor struct {
	EnvPrefix   string
	Unmarshaler func([]byte, any) error
}

func (*Configor) Load

func (c *Configor) Load(dst any, payload ...[]byte) (err error)

func (*Configor) LoadFile

func (c *Configor) LoadFile(dst any, files ...string) error

Load will unmarshal configurations to struct from files that you provide

Jump to

Keyboard shortcuts

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