config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequiredEnvTemplatedError = "the environment variable '%s' must not be empty"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalHealthStatusConfig

type AdditionalHealthStatusConfig struct {
	Endpoint          string
	HealthFunc        func(request entity.HealthRequest) (entity.HealthResponse, error)
	FullHealthEnabled bool
}

type AuthConfig

type AuthConfig struct {
	AuthEnabled                   bool
	SiteManagerServiceAccountName string
	SiteManagerNamespace          string
	SiteManagerCustomAudience     string
}

type Config

func NewConfig

func NewConfig(configLoader ConfigLoader) (*Config, error)

type ConfigLoader

type ConfigLoader interface {
	GetCustomResourceConfig() (*CustomResourceConfig, error)
	GetDisasterRecoveryPaths() (*DisasterRecoveryPath, error)
	GetHealthConfig() (*HealthConfig, error)
	GetAuthConfig() (*AuthConfig, error)
	GetServerConfig() (*ServerConfig, error)
}

type CustomResourceConfig

type CustomResourceConfig struct {
	Name      string
	Namespace string
	Group     string
	Version   string
	Resource  string
}

type DefaultEnvConfigLoader

type DefaultEnvConfigLoader struct {
	// contains filtered or unexported fields
}

func GetDefaultEnvConfigLoader

func GetDefaultEnvConfigLoader() *DefaultEnvConfigLoader

func NewEnvConfigLoader

func NewEnvConfigLoader(envProvider EnvProvider) *DefaultEnvConfigLoader

func (DefaultEnvConfigLoader) GetAdditionalHealthStatusConfig

func (decl DefaultEnvConfigLoader) GetAdditionalHealthStatusConfig() (AdditionalHealthStatusConfig, error)

func (DefaultEnvConfigLoader) GetAuthConfig

func (decl DefaultEnvConfigLoader) GetAuthConfig() (*AuthConfig, error)

func (DefaultEnvConfigLoader) GetCustomResourceConfig

func (decl DefaultEnvConfigLoader) GetCustomResourceConfig() (*CustomResourceConfig, error)

func (DefaultEnvConfigLoader) GetDisasterRecoveryPaths

func (decl DefaultEnvConfigLoader) GetDisasterRecoveryPaths() (*DisasterRecoveryPath, error)

func (DefaultEnvConfigLoader) GetHealthConfig

func (decl DefaultEnvConfigLoader) GetHealthConfig() (*HealthConfig, error)

func (DefaultEnvConfigLoader) GetServerConfig

func (decl DefaultEnvConfigLoader) GetServerConfig() (*ServerConfig, error)

type DisasterRecoveryPath

type DisasterRecoveryPath struct {
	StatusPath     DisasterRecoveryStatusPath
	ModePath       []string
	NoWaitPath     []string
	NoWaitAsString bool
}

type DisasterRecoveryStatusPath

type DisasterRecoveryStatusPath struct {
	ModePath           []string
	StatusPath         []string
	CommentPath        []string
	TreatStatusAsField bool
}

type EnvConfigLoader

type EnvConfigLoader interface {
	ConfigLoader
	// contains filtered or unexported methods
}

type EnvProvider

type EnvProvider interface {
	GetEnv(string, string) string
}

type HealthConfig

type HealthConfig struct {
	ActiveMainServices           map[string][]string
	ActiveAdditionalServices     map[string][]string
	StandbyMainServices          map[string][]string
	StandbyAdditionalServices    map[string][]string
	DisableMainServices          map[string][]string
	DisableAdditionalServices    map[string][]string
	AdditionalHealthStatusConfig AdditionalHealthStatusConfig
	DisasterRecoveryStatusPath   DisasterRecoveryStatusPath
}

type OsEnvProvider

type OsEnvProvider struct{}

func (OsEnvProvider) GetEnv

func (oec OsEnvProvider) GetEnv(key, fallback string) string

type ServerConfig

type ServerConfig struct {
	Port       int
	Suites     []uint16
	TLSEnabled bool
	CertsPath  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳