config

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfigurationVariables

func InitConfigurationVariables(configs []ConfigurationVariables) error

InitConfigurationVariables according to environment

Types

type ConfigurationVariables

type ConfigurationVariables interface {
	LoadFromEnvVars() error
}

ConfigurationVariables is an interface with LoadFromEnvVars method. The method is meant to be implemented as a struct method:

type StructWithVars struct {
	Var1 string        `envconfig:"VAR1"`
	Var2 string        `envconfig:"VAR2"`
}
func (swv *StructWithVars) LoadFromEnvVars() error {
  if err := envconfig.Process("", swv); err != nil {
		return err
	}
	return nil
}

type ControllerConfiguration added in v0.11.0

type ControllerConfiguration struct {
	Environment common.Environment `envconfig:"ENVIRONMENT" required:"true"`
}

ControllerConfiguration defines required and common values for the controllers

func (*ControllerConfiguration) LoadFromEnvVars added in v0.11.0

func (c *ControllerConfiguration) LoadFromEnvVars() error

LoadFromEnvVars for the controller configuration

type Credentials

type Credentials map[string]string

Credentials store the credentials from vault

type ManagerConfiguration

type ManagerConfiguration struct {
	EnableLeaderElection bool   `envconfig:"ENABLE_LEADER_ELECTION" required:"true"`
	LeaderElectionID     string `envconfig:"LEADER_ELECTION_ID" required:"true"`
	Port                 int    `envconfig:"MANAGER_PORT" default:"9443"`
	MetricsServerPort    int    `envconfig:"METRICS_SERVER_PORT" default:"8080"`
	HealthProbeAddress   string `envconfig:"HEALTH_PROBE_ADDRESS" default:":8081"`
	EnableWebhooks       bool   `envconfig:"ENABLE_WEBHOOKS" default:"true"`
	WebhookCertDir       string `envconfig:"WEBHOOK_CERT_DIR" default:"/tmp/k8s-webhook-server/serving-certs"`
}

ManagerConfiguration defines required variables to configure the environment

func (*ManagerConfiguration) LoadFromEnvVars

func (c *ManagerConfiguration) LoadFromEnvVars() error

LoadFromEnvVars from the Manager

type Namespace

type Namespace string

Namespace defines the namespace type that represents the cluster namespace

func (Namespace) String

func (n Namespace) String() string

type RESTControllerConfiguration

type RESTControllerConfiguration struct {
	UserID             string        `envconfig:"USER_ID" default:""`
	UserIDPrefix       string        `envconfig:"USER_ID_PREFIX" default:""`
	HTTPRequestTimeout time.Duration `envconfig:"HTTP_REQUEST_TIMEOUT" default:"30s"`
}

RESTControllerConfiguration defines a struct with required environment variables for rest controller

func (*RESTControllerConfiguration) LoadFromEnvVars

func (c *RESTControllerConfiguration) LoadFromEnvVars() error

LoadFromEnvVars reads all env vars required

type ResourceKind

type ResourceKind string

ResourceKind defines a resource kind type

type UID

type UID string

UID defines UID type represents a ID for a specific resource

type UserID

type UserID string

UserID defines the user id type

Jump to

Keyboard shortcuts

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