env

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppName

func AppName() string

func ConfigPath added in v0.3.0

func ConfigPath() []string

func DataDir added in v0.3.0

func DataDir() string

func ErrorExpire added in v0.4.0

func ErrorExpire() time.Duration

func ErrorLevel added in v0.4.0

func ErrorLevel() log.Level

func ErrorName added in v0.4.0

func ErrorName() string

func ErrorPeriod added in v0.4.0

func ErrorPeriod() string

func ExtenderMarkAddr added in v0.3.0

func ExtenderMarkAddr() string

func ExtendersDir added in v0.3.0

func ExtendersDir() string

func FormatPath added in v0.8.0

func FormatPath(path string) string

func GenEnv

func GenEnv(name, value string) string

func GetArg

func GetArg(cfg *Config, name string) (string, bool)

func GetConfig added in v0.3.0

func GetConfig() map[string]string

func GetDefault

func GetDefault(name string, d string) string

func GetDefaultArg

func GetDefaultArg(cfg *Config, name string, value string) string

func GetEnv

func GetEnv(name string) (string, bool)

func Home added in v0.3.0

func Home() string

Home returns the home directory for the executing user.

This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.

func IsDebug

func IsDebug() bool

func LogDir added in v0.3.0

func LogDir() string

func PidFileDir added in v0.3.0

func PidFileDir() string

func Process added in v0.8.0

func Process() string

func SetEnv

func SetEnv(name string, value string)

func SetProcessName added in v0.8.0

func SetProcessName(s string)

func SocketAddr added in v0.3.0

func SocketAddr(name string, pid int) string

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(path string) *Config

func (*Config) Get

func (c *Config) Get(name string) (string, bool)

func (*Config) GetDefault

func (c *Config) GetDefault(name string, value string) string

func (*Config) ReadFile

func (c *Config) ReadFile(paths ...string)

func (*Config) Save

func (c *Config) Save() error

func (*Config) Set

func (c *Config) Set(name string, value string)

Jump to

Keyboard shortcuts

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