config

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(config *Config) error

Types

type AuthorizationConfig

type AuthorizationConfig struct {
	Enabled         bool
	KetoRemoteRead  string               `validate:"required_if=Enabled True"`
	KetoRemoteWrite string               `validate:"required_if=Enabled True"`
	Caching         *InMemoryCacheConfig `validate:"required_if=Enabled True"`
	UseMiddleware   bool
}

type Config

type Config struct {
	APIHost       string `validate:"required"`
	Environment   string `validate:"required"`
	Port          int    `validate:"required"`
	SentryDSN     string
	OauthClientID string

	Streams Streams `validate:"dive,required"`
	Docs    Documentations

	Applications         []modelsv2.Application `validate:"dive"`
	Authorization        *AuthorizationConfig   `validate:"required"`
	Database             *DatabaseConfig        `validate:"required"`
	Mlflow               *MlflowConfig          `validate:"required"`
	DefaultSecretStorage *SecretStorage         `validate:"required"`
	UI                   *UIConfig
}

func Load

func Load(paths ...string) (*Config, error)

func LoadAndValidate

func LoadAndValidate(paths ...string) (*Config, error)

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) DefaultSecretStorageModel added in v1.8.0

func (c *Config) DefaultSecretStorageModel() *models.SecretStorage

DefaultSecretStorageModel returns the default secret storage model from the given config. The returned secret storage model is a globally-scoped secret storage.

func (*Config) ListenAddress

func (c *Config) ListenAddress() string

type DatabaseConfig

type DatabaseConfig struct {
	Host          string `validate:"required"`
	Port          int    `validate:"required"`
	User          string `validate:"required"`
	Password      string `validate:"required"`
	Database      string `validate:"required"`
	MigrationPath string `validate:"required,url"`

	ConnMaxIdleTime time.Duration
	ConnMaxLifetime time.Duration
	MaxIdleConns    int
	MaxOpenConns    int
}

type Documentation

type Documentation struct {
	Label string `json:"label"`
	Href  string `json:"href"`
}

type Documentations

type Documentations []Documentation

type InMemoryCacheConfig added in v1.9.0

type InMemoryCacheConfig struct {
	Enabled                     bool
	KeyExpirySeconds            int `validate:"required_if=Enabled True"`
	CacheCleanUpIntervalSeconds int `validate:"required_if=Enabled True"`
}

type MlflowConfig

type MlflowConfig struct {
	TrackingURL string `validated:"required,url"`
}

type SecretStorage added in v1.8.0

type SecretStorage struct {
	// Name is the name of the secret storage.
	Name string `validate:"required"`
	// Type is the type of the secret storage.
	Type string `validate:"oneof=internal vault"`
	// Config is the configuration of the secret storage.
	Config models.SecretStorageConfig
}

SecretStorage represents the configuration for a secret storage.

type Streams

type Streams map[string][]string

type UIConfig

type UIConfig struct {
	StaticPath string `validated:"required"`
	IndexPath  string `validated:"required"`

	ClockworkUIHomepage string `json:"REACT_APP_CLOCKWORK_UI_HOMEPAGE"`
	KubeflowUIHomepage  string `json:"REACT_APP_KUBEFLOW_UI_HOMEPAGE"`
}

UIConfig stores the configuration for the UI.

Jump to

Keyboard shortcuts

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