Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecoderOptions

func DecoderOptions(config *mapstructure.DecoderConfig)

DecoderOptions enables necessary mapstructure decode hook functions

func StringToLogLevelHookFunc

func StringToLogLevelHookFunc() mapstructure.DecodeHookFunc

StringToLogLevelHookFunc returns a mapstructure.DecodeHookFunc which parses a logrus Level from a string

func StringToTemplateHookFunc

func StringToTemplateHookFunc() mapstructure.DecodeHookFunc

StringToTemplateHookFunc returns a mapstructure.DecodeHookFunc which parses a template.Template from a string

Types

type Config

type Config struct {
	LogLevel log.Level `mapstructure:"log_level"`
	Timeouts struct {
		Startup  time.Duration
		Shutdown time.Duration
	}

	IAM struct {
		URL           string
		Token         string
		TokenFile     string `mapstructure:"token_file"`
		AllowInsecure bool   `mapstructure:"allow_insecure"`
	}

	LXD struct {
		URL string
		TLS struct {
			// Set CA if using PKI mode
			CA     string
			CAFile string `mapstructure:"ca_file"`

			// Set server certificate if not using PKI
			ServerCert     string `mapstructure:"server_cert"`
			ServerCertFile string `mapstructure:"server_cert_file"`

			ClientCert     string `mapstructure:"client_cert"`
			ClientCertFile string `mapstructure:"client_cert_file"`

			ClientKey     string `mapstructure:"client_key"`
			ClientKeyFile string `mapstructure:"client_key_file"`

			TrustPassword     string `mapstructure:"trust_password"`
			TrustPasswordFile string `mapstructure:"trust_password_file"`

			AllowInsecure bool `mapstructure:"allow_insecure"`
		}
	}

	Webspaces struct {
		LXDProfile      string         `mapstructure:"lxd_profile"`
		InstancePrefix  string         `mapstructure:"instance_prefix"`
		Domain          string         `mapstructure:"domain"`
		ConfigDefaults  WebspaceConfig `mapstructure:"config_defaults"`
		MaxStartupDelay uint16         `mapstructure:"max_startup_delay"`
		IPTimeout       time.Duration  `mapstructure:"ip_timeout"`

		Ports struct {
			Start uint16
			End   uint16
			Max   uint16

			KubernetesService string `mapstructure:"kubernetes_service"`
		}
	}

	HTTP struct {
		ListenAddress string `mapstructure:"listen_address"`

		CORS struct {
			AllowedOrigins []string `mapstructure:"allowed_origins"`
		}
	}

	Traefik struct {
		Provider string

		Redis struct {
			Addr         string
			DB           int
			CertResolver string `mapstructure:"cert_resolver"`
		}
		Kubernetes struct {
			Namespace     string
			DefaultSecret string `mapstructure:"default_secret"`
			ClusterIssuer string `mapstructure:"cluster_issuer"`
		}

		HTTPSEntryPoint string   `mapstructure:"https_entrypoint"`
		DefaultSANs     []string `mapstructure:"default_sans"`

		WebspacedURL string `mapstructure:"webspaced_url"`
		IAMToken     string `mapstructure:"iam_token"`
		IAMTokenFile string `mapstructure:"iam_token_file"`
	}
}

Config describes the configuration for Server

func (*Config) ReadSecrets

func (c *Config) ReadSecrets() error

ReadSecrets loads values for secret config options from files

type WebspaceConfig

type WebspaceConfig struct {
	StartupDelay   float64 `json:"startupDelay" mapstructure:"startup_delay"`
	HTTPPort       uint16  `json:"httpPort" mapstructure:"http_port"`
	SNIPassthrough bool    `json:"sniPassthrough" mapstructure:"sni_passthrough"`
}

WebspaceConfig describes a webspace's basic key = value configuration

Jump to

Keyboard shortcuts

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