config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key string, defaultVal string) string

func LoadConfig

func LoadConfig(file string, v interface{}, opts ...Option) error

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

func LoadConfigFromTomlBytes

func LoadConfigFromTomlBytes(content []byte, v interface{}) error

LoadConfigFromTomlBytes loads config into v from content toml bytes.

Types

type Option

type Option func(opt *options)

Option defines the method to customize the config options.

func SetEnv

func SetEnv(f bool) Option

func UseEnv

func UseEnv() Option

UseEnv customizes the config to use environment variables.

Jump to

Keyboard shortcuts

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