env

package
v1.15.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppName

func AppName() string

func ConfigPath

func ConfigPath() []string

func DataDir

func DataDir() string

func ErrorExpire

func ErrorExpire() time.Duration

func ErrorLevel

func ErrorLevel() log.Level

func ErrorName

func ErrorName() string

func ErrorPeriod

func ErrorPeriod() string

func ExtenderMarkAddr

func ExtenderMarkAddr() string

func ExtendersDir

func ExtendersDir() string

func FormatPath

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

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

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

func LogDir() string

func PidFileDir

func PidFileDir() string

func Process

func Process() string

func SetEnv

func SetEnv(name string, value string)

func SetProcessName

func SetProcessName(s string)

func SocketAddr

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