goconfig

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 9 Imported by: 0

README

goconfig

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(path string) (bool, error)

FileExists checks to see if a file exist at the provided path.

func GetCurrentDirectory

func GetCurrentDirectory() string

GetCurrentDirectory return current directory

func Load added in v1.1.0

func Load[T any](opts ...Option) (*T, error)

Load config from file and env

func LoadWithDefault added in v1.1.0

func LoadWithDefault[T any](t *T, opts ...Option) (*T, error)

LoadWithDefault load config from file and env, if config file not exist, use default config

Types

type Option added in v1.1.0

type Option func(*option)

Option config option

func SetDefaultConfigDirs

func SetDefaultConfigDirs(dirs ...string) Option

Launchd doesn't set root env variables, so there is default

func SetDefaultConfigFiles

func SetDefaultConfigFiles(files ...string) Option

File names from which we attempt to read configuration.

func WithFile added in v1.1.0

func WithFile(path string) Option

WithFile set config file path

Jump to

Keyboard shortcuts

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