config

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationConfig

type AuthorizationConfig struct {
	AuthorizationEnabled   bool   `envconfig:"AUTHORIZATION_ENABLED" default:"false"`
	AuthorizationServerUrl string `envconfig:"AUTHORIZATION_SERVER_URL" default:"http://localhost:4466"`
}

type Config

type Config struct {
	APIHost       string `envconfig:"API_HOST" default:"http://localhost:8080/v1"`
	Port          int    `envconfig:"PORT" default:"8080"`
	Environment   string `envconfig:"ENVIRONMENT" default:"dev"`
	EncryptionKey string `envconfig:"ENCRYPTION_KEY" required:"true"`

	MlflowConfig        MlflowConfig
	DbConfig            DatabaseConfig
	GitlabConfig        GitlabConfig
	AuthorizationConfig AuthorizationConfig
	UI                  UIConfig

	OauthClientID string `envconfig:"OAUTH_CLIENT_ID"`
	SentryDSN     string `envconfig:"SENTRY_DSN"`

	Teams   []string       `envconfig:"TEAM_LIST"`
	Streams []string       `envconfig:"STREAM_LIST"`
	Docs    Documentations `envconfig:"DOC_LIST"`
}

func InitConfigEnv

func InitConfigEnv() (*Config, error)

func (*Config) ListenAddress

func (c *Config) ListenAddress() string

type DatabaseConfig

type DatabaseConfig struct {
	Host     string `envconfig:"DATABASE_HOST" required:"true"`
	Port     int    `envconfig:"DATABASE_PORT" default:"5432"`
	User     string `envconfig:"DATABASE_USER" required:"true"`
	Password string `envconfig:"DATABASE_PASSWORD" required:"true"`
	Database string `envconfig:"DATABASE_NAME" default:"mlp"`
}

type Documentation added in v1.3.1

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

type Documentations added in v1.3.1

type Documentations []Documentation

func (*Documentations) Decode added in v1.3.1

func (docs *Documentations) Decode(value string) error

type GitlabConfig

type GitlabConfig struct {
	Enabled      bool     `envconfig:"GITLAB_ENABLED" default:"false"`
	Host         string   `envconfig:"GITLAB_HOST"`
	ClientID     string   `envconfig:"GITLAB_CLIENT_ID"`
	ClientSecret string   `envconfig:"GITLAB_CLIENT_SECRET"`
	RedirectURL  string   `envconfig:"GITLAB_REDIRECT_URL"`
	Scopes       []string `envconfig:"GITLAB_OAUTH_SCOPES" default:"read_user"`
}

func (*GitlabConfig) InitOauthConfig

func (cfg *GitlabConfig) InitOauthConfig() (*oauth2.Config, error)

type MlflowConfig

type MlflowConfig struct {
	TrackingUrl string `envconfig:"MLFLOW_TRACKING_URL" required:"true"`
}

type UIConfig

type UIConfig struct {
	StaticPath string `envconfig:"UI_STATIC_PATH" default:"ui/build"`
	IndexPath  string `envconfig:"UI_INDEX_PATH" default:"index.html"`

	FeastCoreAPI string `envconfig:"REACT_APP_FEAST_CORE_API" json:"REACT_APP_FEAST_CORE_API"`
	MerlinAPI    string `envconfig:"REACT_APP_MERLIN_API" json:"REACT_APP_MERLIN_API"`
	TuringAPI    string `envconfig:"REACT_APP_TURING_API" json:"REACT_APP_TURING_API"`

	ClockworkUIHomepage string `envconfig:"REACT_APP_CLOCKWORK_UI_HOMEPAGE" json:"REACT_APP_CLOCKWORK_UI_HOMEPAGE"`
	FeastUIHomepage     string `envconfig:"REACT_APP_FEAST_UI_HOMEPAGE" json:"REACT_APP_FEAST_UI_HOMEPAGE"`
	KubeflowUIHomepage  string `envconfig:"REACT_APP_KUBEFLOW_UI_HOMEPAGE" json:"REACT_APP_KUBEFLOW_UI_HOMEPAGE"`
	MerlinUIHomepage    string `envconfig:"REACT_APP_MERLIN_UI_HOMEPAGE" json:"REACT_APP_MERLIN_UI_HOMEPAGE"`
	TuringUIHomepage    string `envconfig:"REACT_APP_TURING_UI_HOMEPAGE" json:"REACT_APP_TURING_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