config

package
v1.2.23 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Invalidate added in v0.1.19

func Invalidate()

Invalidate clears all cached config state, forcing a reload on next Get(). Used when updating the config file and for testing.

func Load

func Load(configFile string) error

Load loads the config file and applies environment overrides. This function is idempotent - calling it multiple times will only load once.

Types

type CommunicationConfig added in v0.1.6

type CommunicationConfig struct {
	Type    string `koanf:"type"`     // "auto", "unix", "tcp"
	TCPPort int    `koanf:"tcp_port"` // Default: 9001
}

type ComparisonConfig

type ComparisonConfig struct {
	IgnoreFields     []string `koanf:"ignore_fields"`
	IgnorePatterns   []string `koanf:"ignore_patterns"`
	IgnoreUUIDs      *bool    `koanf:"ignore_uuids"`
	IgnoreTimestamps *bool    `koanf:"ignore_timestamps"`
	IgnoreDates      *bool    `koanf:"ignore_dates"`
}

type Config

type Config struct {
	Service       ServiceConfig       `koanf:"service"`
	TuskAPI       TuskAPIConfig       `koanf:"tusk_api"`
	Comparison    ComparisonConfig    `koanf:"comparison"`
	TestExecution TestExecutionConfig `koanf:"test_execution"`
	Recording     RecordingConfig     `koanf:"recording"`
	Replay        ReplayConfig        `koanf:"replay"`
	Traces        TracesConfig        `koanf:"traces"`
	Results       ResultsConfig       `koanf:"results"`
}

func Get

func Get() (*Config, error)

Get returns the cached config. If not loaded yet, loads from default location.

func (*Config) Validate

func (cfg *Config) Validate() error

type ReadinessConfig

type ReadinessConfig struct {
	Command  string `koanf:"command"`
	Timeout  string `koanf:"timeout"`
	Interval string `koanf:"interval"`
}

type RecordingConfig

type RecordingConfig struct {
	SamplingRate          float64 `koanf:"sampling_rate"`
	ExportSpans           *bool   `koanf:"export_spans"`
	EnableEnvVarRecording *bool   `koanf:"enable_env_var_recording"`
}

type ReplayConfig added in v0.1.17

type ReplayConfig struct {
}

type ResultsConfig

type ResultsConfig struct {
	Dir string `koanf:"dir"`
}

type ServiceConfig

type ServiceConfig struct {
	ID            string              `koanf:"id"`
	Name          string              `koanf:"name"`
	Port          int                 `koanf:"port"`
	Start         StartConfig         `koanf:"start"`
	Stop          StopConfig          `koanf:"stop"`
	Readiness     ReadinessConfig     `koanf:"readiness_check"`
	Communication CommunicationConfig `koanf:"communication"`
}

type StartConfig

type StartConfig struct {
	Command string `koanf:"command"`
}

type StopConfig added in v0.1.6

type StopConfig struct {
	Command string `koanf:"command"`
}

type TestExecutionConfig

type TestExecutionConfig struct {
	Concurrency int    `koanf:"concurrency"`
	Timeout     string `koanf:"timeout"`
}

type TracesConfig

type TracesConfig struct {
	Dir string `koanf:"dir"`
}

type TuskAPIConfig

type TuskAPIConfig struct {
	URL string `koanf:"url"`
}

Jump to

Keyboard shortcuts

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