config

package module
v0.0.0-...-fbaf9a3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 5 Imported by: 11

README

config

Config wrapper library based on viper.

Installing

go get github.com/alexferl/golib/config

Documentation

Index

Constants

View Source
const (
	AppName = "app-name"
	EnvName = "env-name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppName string
	EnvName string
	// contains filtered or unexported fields
}

Config holds all global configuration for our program.

func New

func New(envVarPrefix string) *Config

New creates a Config instance.

func (*Config) BindFlags

func (c *Config) BindFlags(flagSets ...func(fs *pflag.FlagSet)) error

BindFlags normalizes and parses the command line flags.

func (*Config) BindFlagsWithConfigPaths

func (c *Config) BindFlagsWithConfigPaths(flagSets ...func(fs *pflag.FlagSet)) error

BindFlagsWithConfigPaths normalizes, parses the command line flags and read in config files.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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