config

package
v0.0.0-...-bde7004 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMode

type AuthMode string

AuthMode represents the authentication mode for the dashboard.

const (
	AuthModeAuto  AuthMode = "auto"
	AuthModeToken AuthMode = "token"
)

type Config

type Config struct {
	// Shared/common options (currently used by multiple components)
	AllowedNamespaces []string `mapstructure:"allowed-namespaces"`
	KubeconfigPath    string   `mapstructure:"kubeconfig"`

	Addr               string   `mapstructure:"addr" validate:"omitempty,hostname_port"`
	AuthMode           AuthMode `mapstructure:"auth-mode"`
	BasePath           string   `mapstructure:"base-path"`
	ClusterAPIEndpoint string   `mapstructure:"cluster-api-endpoint"`
	GinMode            string   `mapstructure:"gin-mode" validate:"omitempty,oneof=debug release"`
	Environment        sharedcfg.Environment

	// csrf options
	CSRF struct {
		Enabled bool
	}

	// logging options
	Logging struct {
		Enabled bool
		Level   string `validate:"oneof=debug info warn error disabled"`
		Format  string `validate:"oneof=json pretty"`

		// access-log options
		AccessLog struct {
			Enabled          bool
			HideHealthChecks bool `mapstructure:"hide-health-checks"`
		} `mapstructure:"access-log"`
	}

	// session options
	Session struct {
		Secret string

		// cookie options
		Cookie struct {
			Name     string
			Path     string
			Domain   string
			MaxAge   int `mapstructure:"max-age"`
			Secure   bool
			HttpOnly bool          `mapstructure:"http-only"`
			SameSite http.SameSite `mapstructure:"same-site"`
		}
	}

	// TLS options
	TLS struct {
		Enabled  bool
		CertFile string `mapstructure:"cert-file" validate:"omitempty,file"`
		KeyFile  string `mapstructure:"key-file" validate:"omitempty,file"`
	}

	// UI options
	UI struct {
		ClusterAPIEnabled bool `mapstructure:"cluster-api-enabled"`
	}
}

Represents the Dashboard configuration

func DefaultConfig

func DefaultConfig() *Config

func NewConfig

func NewConfig(v *viper.Viper, configPath string) (*Config, error)

Jump to

Keyboard shortcuts

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