env

package
v0.0.0-...-facc64f Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProjectDirectory, _ = os.Getwd()
	Environment         = os.Getenv("ENV")
	Host                = os.Getenv("HOST")
	HostName            = os.Getenv("HOSTNAME")
	ServiceConfigPath   = os.Getenv("CONFIG_PATH")
)

Functions

func InitEnvironment

func InitEnvironment()

Types

type AuthConfig

type AuthConfig struct {
	PublicKeyPath  string               `yaml:"publicKeyPath"`
	AuthEndpoint   string               `yaml:"authEndpoint"`
	TLSCertificate *meta.TLSCertificate `yaml:"tlsCertificate"`
}

type CommonConfig

type CommonConfig struct {
	Host               string `yaml:"host"`
	HostName           string `yaml:"hostname"`
	ContentType        string `yaml:"contentType"`
	InnerServiceFormat string `yaml:"innerServiceFormat"`
}

type ElasticConfig

type ElasticConfig struct {
	URL          string `yaml:"URL"`
	Index        string `yaml:"index"`
	StartupDelay int    `yaml:"startupDelay"`
	Sniffing     bool   `yaml:"sniffing"`
}

type SearchConfig

type SearchConfig struct {
	Type      string   `yaml:"type"`
	Fuzziness string   `yaml:"fuzziness"`
	Slop      int      `yaml:"slop"`
	Fields    []string `yaml:"Fields"`
}

type SecurityConfig

type SecurityConfig struct {
	TLSCertificate *meta.TLSCertificate `yaml:"tlsCertificate"`
}

type ServiceConfig

type ServiceConfig struct {
	Common   CommonConfig   `yaml:"commonConfig"`
	Security SecurityConfig `yaml:"securityConfig"`
	Auth     AuthConfig     `yaml:"authConfig"`
	Elastic  ElasticConfig  `yaml:"elasticConfig"`
	Search   SearchConfig   `yaml:"searchConfig"`
}

func ReadServiceConfig

func ReadServiceConfig(filename string) (sc ServiceConfig, err error)

Jump to

Keyboard shortcuts

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