Documentation ¶
Index ¶
- Constants
- Variables
- func GetBool(name string, fallback bool) (bool, error)
- func GetDuration(name string, fallback time.Duration) (time.Duration, error)
- func GetInt(name string, fallback int) (int, error)
- func GetString(name string, fallback string) string
- func InitializeEnv() error
- func LookupEnv(key string) (string, bool)
- func SanitizerEnv(removeKey ...string) []string
- type Broker
- type Builder
- type K
- func (k K) Find() string
- func (k K) SimpleAtob(dv bool) bool
- func (k K) SimpleAtoi(dv int64) int64
- func (k K) StrSplit(sep string) []string
- func (k K) Strings() []string
- func (k K) With(s string) string
- func (k K) WithBool(b bool) string
- func (k K) WithInt(i int64) string
- func (k K) WithPaths(sv []string) string
- func (k K) Withs(sv []string) string
Constants ¶
const ( ZETA_TERMINAL_PROMPT K = "ZETA_TERMINAL_PROMPT" ZETA_NO_SSH_AUTH_SOCK K = "ZETA_NO_SSH_AUTH_SOCK" StandardSeparator string = ";" )
VALUE
Variables ¶
Functions ¶
func GetBool ¶
GetBool fetches and parses a boolean typed environment variable
If the variable is empty, returns `fallback` and no error. If there is an error, returns `fallback` and the error.
func GetDuration ¶
GetDuration fetches and parses a duration typed environment variable
func GetInt ¶
GetInt fetches and parses an integer typed environment variable
If the variable is empty, returns `fallback` and no error. If there is an error, returns `fallback` and the error.
func GetString ¶
GetString fetches a given name from the environment and falls back to a default value if the name is not available. The value is stripped of leading and trailing whitespace.
func InitializeEnv ¶
func InitializeEnv() error
func SanitizerEnv ¶
Types ¶
type Broker ¶
type Broker interface { ExpandEnv(s string) string LookupEnv(key string) (string, bool) Getenv(string) string Setenv(key, value string) error Unsetenv(key string) error Environ() []string Clearenv() }
var (
SystemBroker Broker = &broker{}
)
func DeriveSanitizer ¶
func NewSanitizer ¶
func NewSanitizer() Broker
type Builder ¶
type Builder interface {
Environ() []string
}
func NewBuilder ¶
func NewBuilder() Builder
type K ¶
type K string
func (K) SimpleAtob ¶
SimpleAtob Obtain the boolean variable from the environment variable, if it does not exist, return the default value