api

package
v0.0.0-...-110fe3a Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 66 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context)

Types

type Config

type Config struct {
	// Tenant is the active tenant
	Tenant string `env:"TENANT,default=dev-nais"`

	// TenantDomain The domain for the tenant.
	TenantDomain string `env:"TENANT_DOMAIN,default=example.com"`

	// GoogleManagementProjectID The ID of the NAIS management project in the tenant organization in GCP.
	GoogleManagementProjectID string `env:"GOOGLE_MANAGEMENT_PROJECT_ID"`

	// DatabaseConnectionString is the database DSN
	DatabaseConnectionString string `env:"DATABASE_URL,default=postgres://api:api@127.0.0.1:3002/api?sslmode=disable"`

	LogFormat string `env:"LOG_FORMAT,default=json"`
	LogLevel  string `env:"LOG_LEVEL,default=info"`

	// StaticServiceAccounts A JSON-encoded value describing a set of service accounts to be created when the
	// application starts. Refer to the README for the format.
	StaticServiceAccounts fixtures.ServiceAccounts `env:"STATIC_SERVICE_ACCOUNTS"`

	// ResourceUtilization is the configuration for the resource utilization service
	ResourceUtilizationImportEnabled bool `env:"RESOURCE_UTILIZATION_IMPORT_ENABLED"`

	// WithFakeKubernetes When set to true, the api will use a fake kubernetes client.
	WithFakeClients bool `env:"WITH_FAKE_CLIENTS"`

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

	// GRPCListenAddress is host:port combination used by the GRPC server
	GRPCListenAddress string `env:"GRPC_LISTEN_ADDRESS,default=127.0.0.1:3001"`

	K8s             k8sConfig
	Usersync        usersyncConfig
	Cost            costConfig
	DependencyTrack dependencyTrackConfig
	Hookd           hookdConfig
	OAuth           oAuthConfig
	Unleash         unleashConfig
	Slack           slackConfig
}

func NewConfig

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

NewConfig creates a new configuration instance from environment variables

func (*Config) ToVulnerabilitiesConfig

func (c *Config) ToVulnerabilitiesConfig(clusters []string) *vulnerabilities.Config

type StaticCluster

type StaticCluster struct {
	Name  string
	Host  string
	Token string
}

func (*StaticCluster) EnvDecode

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

Jump to

Keyboard shortcuts

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