config

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

func LoadConfig

func LoadConfig(configEntry interface{}) error

func LoadEnvFile

func LoadEnvFile(envfile string)

func Parseln

func Parseln(line string) (string, string, error)

helper function to parse a "key=value" environment variable string.

Types

type Config

type Config struct {
	CraneAddr         string   `env:"CRANE_ADDR",required:"true"`
	SwarmManagerIP    string   `env:"CRANE_SWARM_MANAGER_IP",required:"true"`
	DockerEntryScheme string   `required:"false"`
	DockerEntryPort   string   `env:"CRANE_DOCKER_ENTRY_PORT",required:"false"`
	DockerTlsVerify   bool     `env:"CRANE_DOCKER_TLS_VERIFY",required:"true"`
	DockerCertPath    string   `env:"CRANE_DOCKER_CERT_PATH",required:"true"`
	DockerApiVersion  string   `env:"CRANE_DOCKER_API_VERSION",required:"false"`
	DbDriver          string   `env:"CRANE_DB_DRIVER",required:"true"`
	DbDSN             string   `env:"CRANE_DB_DSN",required:"true"`
	FeatureFlags      []string `env:"CRANE_FEATURE_FLAGS",required:"true"`

	// registry
	RegistryPrivateKeyPath string `env:"CRANE_REGISTRY_PRIVATE_KEY_PATH",required:"true"`
	RegistryAddr           string `env:"CRANE_REGISTRY_ADDR",required:"true"`

	// account
	AccountAuthenticator string `env:"CRANE_ACCOUNT_AUTHENTICATOR",required:"false"`
	AccountTokenStore    string `env:"CRANE_ACCOUNT_TOKEN_STORE",required:"false"`

	AccountEmailDefault    string `env:"CRANE_ACCOUNT_EMAIL_DEFAULT",required:"false"`
	AccountPasswordDefault string `env:"CRANE_ACCOUNT_PASSWORD_DEFAULT",required:"false"`

	CatalogPath string `env:"CRANE_CATALOG_PATH",required:"false"`

	SearchLoadDataInterval uint16 `env:"CRANE_SEARCH_LOAD_DATA_INTERVAL",required:"false"`
}

func GetConfig

func GetConfig() *Config

func (*Config) FeatureEnabled

func (c *Config) FeatureEnabled(feature string) bool

Jump to

Keyboard shortcuts

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