config

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package config provides configuration management for TestGen.

This package uses Viper for loading configuration from: - YAML config files (.testgen.yaml) - Environment variables (TESTGEN_*) - CLI flags

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAPIKey

func GetAPIKey(cfg *Config) string

GetAPIKey retrieves the API key for the configured provider

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the path to the config file

Types

type Config

type Config struct {
	LLM        LLMConfig        `mapstructure:"llm"`
	Generation GenerationConfig `mapstructure:"generation"`
	Output     OutputConfig     `mapstructure:"output"`
	Languages  LanguagesConfig  `mapstructure:"languages"`
}

Config represents the full TestGen configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration

func Load

func Load() (*Config, error)

Load loads configuration from files and environment

type GenerationConfig

type GenerationConfig struct {
	BatchSize       int `mapstructure:"batch_size"`
	ParallelWorkers int `mapstructure:"parallel_workers"`
	TimeoutSeconds  int `mapstructure:"timeout_seconds"`
}

GenerationConfig contains test generation settings

type LLMConfig

type LLMConfig struct {
	Provider    string  `mapstructure:"provider"`
	Model       string  `mapstructure:"model"`
	APIKeyEnv   string  `mapstructure:"api_key_env"`
	Temperature float32 `mapstructure:"temperature"`
	MaxTokens   int     `mapstructure:"max_tokens"`
}

LLMConfig contains LLM provider settings

type LanguageSettings

type LanguageSettings struct {
	Frameworks       []string `mapstructure:"frameworks"`
	DefaultFramework string   `mapstructure:"default_framework"`
}

LanguageSettings contains settings for a specific language

type LanguagesConfig

type LanguagesConfig struct {
	JavaScript LanguageSettings `mapstructure:"javascript"`
	Python     LanguageSettings `mapstructure:"python"`
	Go         LanguageSettings `mapstructure:"go"`
	Rust       LanguageSettings `mapstructure:"rust"`
}

LanguagesConfig contains per-language settings

type OutputConfig

type OutputConfig struct {
	Format          string `mapstructure:"format"`
	IncludeCoverage bool   `mapstructure:"include_coverage"`
}

OutputConfig contains output settings

Jump to

Keyboard shortcuts

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