config

package
v0.0.0-...-455c6d0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(com *cobra.Command)

Types

type Config

type Config struct {
	Meta                MetaConfig
	Server              ServerConfig
	Google              GoogleConfig
	Teams               TeamsConfig
	Unleash             UnleashConfig
	DebugMode           bool
	CloudConnectorProxy string `env:"BIFROST_CLOUD_CONNECTOR_PROXY_IMAGE,default=gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.1.0"`
}

func New

func New(ctx context.Context) *Config

func (*Config) GetServerAddr

func (c *Config) GetServerAddr() string

func (*Config) GinMiddleware

func (c *Config) GinMiddleware() gin.HandlerFunc

func (*Config) GoogleIAPAudience

func (c *Config) GoogleIAPAudience() string

func (*Config) GoogleProjectURL

func (c *Config) GoogleProjectURL(path string) string

type GoogleConfig

type GoogleConfig struct {
	ProjectID           string `env:"BIFROST_GOOGLE_PROJECT_ID,required"`
	ProjectNumber       string `env:"BIFROST_GOOGLE_PROJECT_NUMBER,required"`
	IAPBackendServiceID string `env:"BIFROST_GOOGLE_IAP_BACKEND_SERVICE_ID,required"`
}

type MetaConfig

type MetaConfig struct {
	Version string `env:"BIFROST_VERSION,default=unknown"`
	Repo    string `env:"BIFROST_REPO,default=nais/bifrost"`
}

func (*MetaConfig) BuildDate

func (m *MetaConfig) BuildDate() string

func (*MetaConfig) Commit

func (m *MetaConfig) Commit() string

func (*MetaConfig) CommitUrl

func (m *MetaConfig) CommitUrl() string

func (*MetaConfig) RepoUrl

func (m *MetaConfig) RepoUrl() string

func (*MetaConfig) VersionUrl

func (m *MetaConfig) VersionUrl() string

type ServerConfig

type ServerConfig struct {
	Port            string `env:"BIFROST_PORT,default=8080"`
	Host            string `env:"BIFROST_HOST,default=0.0.0.0"`
	WriteTimeout    int    `env:"BIFROST_WRITE_TIMEOUT,default=15"`
	ReadTimeout     int    `env:"BIFROST_READ_TIMEOUT,default=15"`
	IdleTimeout     int    `env:"BIFROST_IDLE_TIMEOUT,default=60"`
	GracefulTimeout int    `env:"BIFROST_GRACEFUL_TIMEOUT,default=15"`
	TemplatesDir    string `env:"BIFROST_TEMPLATE_DIR,default=./templates"`
}

type TeamsConfig

type TeamsConfig struct {
	TeamsApiURL   string `env:"BIFROST_TEAMS_API_URL,required"`
	TeamsApiToken string `env:"BIFROST_TEAMS_API_TOKEN,required"`
}

type UnleashConfig

type UnleashConfig struct {
	InstanceNamespace       string `env:"BIFROST_UNLEASH_INSTANCE_NAMESPACE,required"`
	InstanceServiceaccount  string `env:"BIFROST_UNLEASH_INSTANCE_SERVICEACCOUNT,required"`
	SQLInstanceID           string `env:"BIFROST_UNLEASH_SQL_INSTANCE_ID,required"`
	SQLInstanceRegion       string `env:"BIFROST_UNLEASH_SQL_INSTANCE_REGION,required"`
	SQLInstanceAddress      string `env:"BIFROST_UNLEASH_SQL_INSTANCE_ADDRESS,required"`
	InstanceWebIngressHost  string `env:"BIFROST_UNLEASH_INSTANCE_WEB_INGRESS_HOST,required"`
	InstanceWebIngressClass string `env:"BIFROST_UNLEASH_INSTANCE_WEB_INGRESS_CLASS,required"`
	InstanceAPIIngressHost  string `env:"BIFROST_UNLEASH_INSTANCE_API_INGRESS_HOST,required"`
	InstanceAPIIngressClass string `env:"BIFROST_UNLEASH_INSTANCE_API_INGRESS_CLASS,required"`
	TeamsApiURL             string `env:"BIFROST_UNLEASH_INSTANCE_TEAMS_API_URL,required"`
	TeamsApiSecretName      string `env:"BIFROST_UNLEASH_INSTANCE_TEAMS_API_SECRET_NAME,required"`
	TeamsApiSecretTokenKey  string `env:"BIFROST_UNLEASH_INSTANCE_TEAMS_API_TOKEN_SECRET_KEY,required"`
}

Jump to

Keyboard shortcuts

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