config

package
v0.0.0-...-be2aeb8 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Cost                Cost
	Hookd               Hookd
	K8S                 K8S
	Logger              Logger
	DependencyTrack     DependencyTrack
	ResourceUtilization ResourceUtilization
	Teams               Teams

	// IapAudience is the audience for the IAP JWT token. Will not be used when RUN_AS_USER is set
	IapAudience string `env:"IAP_AUDIENCE"`

	// DatabaseConnectionString is the database DSN
	DatabaseConnectionString string `env:"CONSOLE_DATABASE_URL,default=postgres://postgres:postgres@127.0.0.1:5432/console?sslmode=disable"`

	// ListenAddress is host:port combination used by the http server
	ListenAddress string `env:"LISTEN_ADDRESS,default=:8080"`

	// RunAsUser is the static user to run as. Used for development purposes. Will override IAP_AUDIENCE when set
	RunAsUser string `env:"RUN_AS_USER"`

	// Tenant is the active tenant
	Tenant string `env:"TENANT,default=dev-nais"`
}

Config is the configuration for the console-backend application

func New

func New(ctx context.Context, lookuper envconfig.Lookuper) (*Config, error)

New creates a new configuration instance from environment variables

type Cost

type Cost struct {
	ImportEnabled     bool   `env:"COST_DATA_IMPORT_ENABLED,default=false"`
	BigQueryProjectID string `env:"BIGQUERY_PROJECTID,default=*detect-project-id*"`
}

Cost is the configuration for the cost service

type DependencyTrack

type DependencyTrack struct {
	Endpoint string `env:"DEPENDENCYTRACK_ENDPOINT,default=http://dependencytrack-backend:8080"`
	Frontend string `env:"DEPENDENCYTRACK_FRONTEND"`
	Username string `env:"DEPENDENCYTRACK_USERNAME,default=console"`
	Password string `env:"DEPENDENCYTRACK_PASSWORD"`
}

DependencyTrack is the configuration for the dependency track service

type Hookd

type Hookd struct {
	Endpoint string `env:"HOOKD_ENDPOINT,default=http://hookd"`
	PSK      string `env:"HOOKD_PSK,default=secret-frontend-psk"`
}

Hookd is the configuration for the hookd service

type K8S

type K8S struct {
	Clusters        []string        `env:"KUBERNETES_CLUSTERS"`
	StaticClusters  []StaticCluster `env:"KUBERNETES_CLUSTERS_STATIC"`
	AllClusterNames []string
}

K8S is the configuration related to Kubernetes

type Logger

type Logger struct {
	Format string `env:"LOG_FORMAT,default=json"`
	Level  string `env:"LOG_LEVEL,default=info"`
}

Logger is the configuration for the logger

type ResourceUtilization

type ResourceUtilization struct {
	ImportEnabled bool `env:"RESOURCE_UTILIZATION_IMPORT_ENABLED,default=false"`
}

ResourceUtilization is the configuration for the resource utilization service

type StaticCluster

type StaticCluster struct {
	Name  string
	Host  string
	Token string
}

func (*StaticCluster) EnvDecode

func (c *StaticCluster) EnvDecode(value string) error

type Teams

type Teams struct {
	Endpoint string `env:"TEAMS_ENDPOINT,default=http://teams-backend/query"`
	Token    string `env:"TEAMS_TOKEN,default=secret-admin-api-key"`
}

Teams is the configuration for the teams backend service

Jump to

Keyboard shortcuts

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