config

package
v0.8.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnonymousAuthConfig added in v0.2.0

type AnonymousAuthConfig struct {
	Enabled bool   `mapstructure:"enabled"`
	Role    string `mapstructure:"role"`
}

type BannerConfig added in v0.4.0

type BannerConfig struct {
	Enabled     bool   `mapstructure:"enabled"`
	Dismissible bool   `mapstructure:"dismissible"`
	Variant     string `mapstructure:"variant"`
	Message     string `mapstructure:"message"`
	ID          string `mapstructure:"id"`
}

type Config

type Config struct {
	Server struct {
		Port                  int               `mapstructure:"port"`
		Host                  string            `mapstructure:"host"`
		RootURL               string            `mapstructure:"root_url"`
		CustomResponseHeaders map[string]string `mapstructure:"customer_response_headers"`
		EncryptionKey         string            `mapstructure:"encryption_key"`
		AllowUnencrypted      bool              `mapstructure:"allow_unencrypted"`
		TLS                   *TLSConfig        `mapstructure:"tls"`
	} `mapstructure:"server"`

	Metrics struct {
		Enabled             bool     `mapstructure:"enabled"`
		Port                int      `mapstructure:"port"`
		OwnerMetadataFields []string `mapstructure:"owner_metadata_fields"`
		Schemas             struct {
			ExcludedAssetTypes []string `mapstructure:"excluded_asset_types"`
			ExcludedProviders  []string `mapstructure:"excluded_providers"`
		} `mapstructure:"schemas"`
	} `mapstructure:"metrics"`

	Database struct {
		Host         string `mapstructure:"host"`
		Port         int    `mapstructure:"port"`
		User         string `mapstructure:"user"`
		Password     string `mapstructure:"password"`
		Name         string `mapstructure:"name"`
		SSLMode      string `mapstructure:"sslmode"`
		MaxConns     int    `mapstructure:"max_conns"`
		IdleConns    int    `mapstructure:"idle_conns"`
		ConnLifetime int    `mapstructure:"conn_lifetime"`
	} `mapstructure:"database"`

	Logging struct {
		Level  string `mapstructure:"level"`
		Format string `mapstructure:"format"`
	} `mapstructure:"logging"`

	Auth struct {
		Google      *OAuthProviderConfig `mapstructure:"google"`
		GenericOIDC *OAuthProviderConfig `mapstructure:"generic_oidc"`
		GitHub      *OAuthProviderConfig `mapstructure:"github"`
		GitLab      *OAuthProviderConfig `mapstructure:"gitlab"`
		Keycloak    *OAuthProviderConfig `mapstructure:"keycloak"`
		Okta        *OAuthProviderConfig `mapstructure:"okta"`
		Slack       *OAuthProviderConfig `mapstructure:"slack"`
		Auth0       *OAuthProviderConfig `mapstructure:"auth0"`
		Anonymous   AnonymousAuthConfig  `mapstructure:"anonymous"`
	} `mapstructure:"auth"`

	OpenLineage struct {
		Auth struct {
			Enabled bool `mapstructure:"enabled"`
		} `mapstructure:"auth"`
	} `mapstructure:"openlineage"`

	RateLimit RateLimitConfig `mapstructure:"rate_limit"`

	UI struct {
		Banner BannerConfig `mapstructure:"banner"`
	} `mapstructure:"ui"`

	Search struct {
		Timeout       int                  `mapstructure:"timeout"` // seconds
		Elasticsearch *ElasticsearchConfig `mapstructure:"elasticsearch"`
	} `mapstructure:"search"`

	Pipelines struct {
		MaxWorkers        int `mapstructure:"max_workers"`
		SchedulerInterval int `mapstructure:"scheduler_interval"`
		LeaseExpiry       int `mapstructure:"lease_expiry"`
		ClaimExpiry       int `mapstructure:"claim_expiry"`
	} `mapstructure:"pipelines"`
}

Config holds all configuration for the application

func Get

func Get() *Config

Get returns the current config, panics if config is not loaded

func Load

func Load(configPath string) (*Config, error)

Load initializes and loads the config

func (*Config) BuildDSN

func (c *Config) BuildDSN() string

BuildDSN builds a PostgreSQL connection string from config

type ElasticsearchConfig added in v0.8.0

type ElasticsearchConfig struct {
	Enabled        bool       `mapstructure:"enabled"`
	Addresses      []string   `mapstructure:"addresses"`
	Username       string     `mapstructure:"username"`
	Password       string     `mapstructure:"password"`
	Index          string     `mapstructure:"index"`
	TLS            *TLSConfig `mapstructure:"tls"`
	BulkSize       int        `mapstructure:"bulk_size"`
	FlushInterval  int        `mapstructure:"flush_interval"` // milliseconds
	ReindexOnStart bool       `mapstructure:"reindex_on_start"`
	Shards         *int       `mapstructure:"shards"`
	Replicas       *int       `mapstructure:"replicas"`
}

ElasticsearchConfig holds configuration for the optional Elasticsearch search backend.

type GroupMapConfig

type GroupMapConfig struct {
	GroupName string   `mapstructure:"group_name"`
	Roles     []string `mapstructure:"roles"`
}

type OAuthProviderConfig

type OAuthProviderConfig struct {
	Enabled      bool             `mapstructure:"enabled"`
	Type         string           `mapstructure:"type"`
	Name         string           `mapstructure:"name"`
	ClientID     string           `mapstructure:"client_id"`
	ClientSecret string           `mapstructure:"client_secret"`
	URL          string           `mapstructure:"url"`
	Realm        string           `mapstructure:"realm"`
	RedirectURL  string           `mapstructure:"redirect_url"`
	Scopes       []string         `mapstructure:"scopes"`
	AllowSignup  bool             `mapstructure:"allow_signup"`
	GroupMapping []GroupMapConfig `mapstructure:"group_mapping"`
	TeamSync     TeamSyncConfig   `mapstructure:"team_sync"`
	TLS          *TLSConfig       `mapstructure:"tls"`
}

type RateLimitConfig added in v0.3.2

type RateLimitConfig struct {
	Enabled bool `mapstructure:"enabled"`
}

type TLSConfig added in v0.8.0

type TLSConfig struct {
	InsecureSkipVerify bool   `mapstructure:"insecure_skip_verify"`
	CACertPath         string `mapstructure:"ca_cert_path"`
	CertPath           string `mapstructure:"cert_path"`
	KeyPath            string `mapstructure:"key_path"`
}

TLSConfig holds TLS configuration for connecting to services with custom certificates.

func (*TLSConfig) HTTPClient added in v0.8.0

func (t *TLSConfig) HTTPClient() (*http.Client, error)

HTTPClient builds an *http.Client configured with the TLS settings. Returns nil, nil when the receiver is nil (callers should use the default client).

func (*TLSConfig) ToServerTLSConfig added in v0.8.0

func (t *TLSConfig) ToServerTLSConfig() (*tls.Config, error)

ToServerTLSConfig builds a *crypto/tls.Config suitable for an HTTP server. CertPath/KeyPath provide the server's own certificate. CACertPath, if set, enables mutual TLS by requiring and verifying client certificates.

func (*TLSConfig) ToTLSConfig added in v0.8.0

func (t *TLSConfig) ToTLSConfig() (*tls.Config, error)

ToTLSConfig builds a *crypto/tls.Config from the struct fields.

type TeamGroupConfig added in v0.4.0

type TeamGroupConfig struct {
	Claim  string          `mapstructure:"claim"`
	Filter TeamGroupFilter `mapstructure:"filter"`
}

type TeamGroupFilter added in v0.4.0

type TeamGroupFilter struct {
	Mode    string `mapstructure:"mode"`
	Pattern string `mapstructure:"pattern"`
}

type TeamSyncConfig added in v0.4.0

type TeamSyncConfig struct {
	Enabled     bool            `mapstructure:"enabled"`
	StripPrefix string          `mapstructure:"strip_prefix"`
	Group       TeamGroupConfig `mapstructure:"group"`
}

Jump to

Keyboard shortcuts

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