conf

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(file string, v any, opts ...Option) error

Load loads config into v from file, .json, .yaml and .yml are acceptable.

func LoadConfigFromYamlBytes

func LoadConfigFromYamlBytes(content []byte, v any) error

LoadConfigFromYamlBytes loads config into v from content yaml bytes. Deprecated: use LoadFromYamlBytes instead.

func LoadFromJsonBytes

func LoadFromJsonBytes(content []byte, v any) error

LoadFromJsonBytes loads config into v from content json bytes.

func LoadFromTomlBytes

func LoadFromTomlBytes(content []byte, v any) error

LoadFromTomlBytes loads config into v from content toml bytes.

func LoadFromYamlBytes

func LoadFromYamlBytes(content []byte, v any) error

LoadFromYamlBytes loads config into v from content yaml bytes.

func MustLoad

func MustLoad(path string, v any, opts ...Option)

MustLoad loads config into v from path, exits on error.

Types

type Option

type Option func(opt *options)

Option defines the method to customize the config options.

func UseEnv

func UseEnv() Option

UseEnv customizes the config to use environment variables.

func UseFS added in v0.0.4

func UseFS(fs embed.FS) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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