env

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const BroadcastIP = "BROADCAST_IP"
View Source
const ClusterAddress = "CLUSTER_ADDRESS"
View Source
const IP = "IP"
View Source
const IsJoin = "IS_JOIN"
View Source
const NodeID = "NODE_ID"
View Source
const NodeKey = "NODE_KEY"
View Source
const PluginPath = "PLUGINS_DIR"
View Source
const Port = "PORT"
View Source
const Protocol = "PROTOCOL"

Variables

This section is empty.

Functions

func AppName

func AppName() string

func EnvName

func EnvName(name string) string

func Envs

func Envs() []string

func GenEnv

func GenEnv(name, value string) string

func GetArg

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

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 IsDebug

func IsDebug() bool

func SetEnv

func SetEnv(name string, value 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