config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

ConfigDir returns the opsmate config directory path.

Types

type BasicAuth

type BasicAuth struct {
	Username string `mapstructure:"username" yaml:"username"`
	Password string `mapstructure:"password" yaml:"password"`
}

type ClaudeConfig

type ClaudeConfig struct {
	Model        string `mapstructure:"model" yaml:"model"`
	CustomPrompt string `mapstructure:"custom_prompt" yaml:"custom_prompt"`
}

type Config

type Config struct {
	Servers ServerConfigs `mapstructure:"servers" yaml:"servers"`
	Safety  SafetyConfig  `mapstructure:"safety" yaml:"safety"`
	Claude  ClaudeConfig  `mapstructure:"claude" yaml:"claude"`
}

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration.

func Load

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

Load reads the configuration from file and environment.

type DockerConfig

type DockerConfig struct {
	Enabled  bool   `mapstructure:"enabled" yaml:"enabled"`
	Host     string `mapstructure:"host" yaml:"host"`
	ReadOnly bool   `mapstructure:"readonly" yaml:"readonly"`
}

type FilesConfig

type FilesConfig struct {
	Enabled   bool     `mapstructure:"enabled" yaml:"enabled"`
	ScanPaths []string `mapstructure:"scan_paths" yaml:"scan_paths"`
	Rulesets  []string `mapstructure:"rulesets" yaml:"rulesets"`
}

type KubernetesConfig

type KubernetesConfig struct {
	Enabled    bool     `mapstructure:"enabled" yaml:"enabled"`
	Kubeconfig string   `mapstructure:"kubeconfig" yaml:"kubeconfig"`
	Context    string   `mapstructure:"context" yaml:"context"`
	Namespaces []string `mapstructure:"namespaces" yaml:"namespaces"`
	ReadOnly   bool     `mapstructure:"readonly" yaml:"readonly"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Enabled   bool       `mapstructure:"enabled" yaml:"enabled"`
	URL       string     `mapstructure:"url" yaml:"url"`
	BasicAuth *BasicAuth `mapstructure:"basicAuth" yaml:"basicAuth,omitempty"`
}

type SafetyConfig

type SafetyConfig struct {
	ConfirmDestructive bool `mapstructure:"confirm_destructive" yaml:"confirm_destructive"`
	MaxLogLines        int  `mapstructure:"max_log_lines" yaml:"max_log_lines"`
	RedactSecrets      bool `mapstructure:"redact_secrets" yaml:"redact_secrets"`
}

type ServerConfigs

type ServerConfigs struct {
	Kubernetes KubernetesConfig `mapstructure:"kubernetes" yaml:"kubernetes"`
	Docker     DockerConfig     `mapstructure:"docker" yaml:"docker"`
	Prometheus PrometheusConfig `mapstructure:"prometheus" yaml:"prometheus"`
	Files      FilesConfig      `mapstructure:"files" yaml:"files"`
}

Jump to

Keyboard shortcuts

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