config

package
v0.1.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAPIKey

func GetAPIKey() string

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.

func ResetForTesting

func ResetForTesting()

ResetForTesting clears all cached config state. Only use this in tests.

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"`
	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"`
}

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