config

package
v0.0.0-...-ae0b575 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureConfigDir

func EnsureConfigDir() error

EnsureConfigDir creates the configuration directory if it doesn't exist

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the default configuration file path

func SaveConfig

func SaveConfig(config *Config, filename string) error

SaveConfig saves configuration to a file

Types

type AnalyzerConfig

type AnalyzerConfig struct {
	EnableOptimizations bool `json:"enable_optimizations" yaml:"enable_optimizations"`
	ComplexityThreshold int  `json:"complexity_threshold" yaml:"complexity_threshold"`
	DetailedAnalysis    bool `json:"detailed_analysis" yaml:"detailed_analysis"`
}

type Config

type Config struct {
	Parser   ParserConfig   `json:"parser" yaml:"parser"`
	Analyzer AnalyzerConfig `json:"analyzer" yaml:"analyzer"`
	Logger   LoggerConfig   `json:"logger" yaml:"logger"`
	Output   OutputConfig   `json:"output" yaml:"output"`
}

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a configuration with sensible defaults

func LoadConfig

func LoadConfig(filename string) (*Config, error)

LoadConfig loads configuration from a file

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

type FilterConfig

type FilterConfig struct {
	// Minimum duration in milliseconds
	MinDurationMs int64 `json:"min_duration_ms" yaml:"min_duration_ms"`

	// Maximum duration in milliseconds
	MaxDurationMs int64 `json:"max_duration_ms" yaml:"max_duration_ms"`

	// Include only specific query types
	QueryTypes []string `json:"query_types" yaml:"query_types"`

	// Exclude system queries
	ExcludeSystem bool `json:"exclude_system" yaml:"exclude_system"`
}

type LoggerConfig

type LoggerConfig struct {
	DefaultFormat string `json:"default_format" yaml:"default_format"`

	// Maximum log file size to process (in MB)
	MaxFileSizeMB int `json:"max_file_size_mb" yaml:"max_file_size_mb"`

	// Filter settings
	Filters FilterConfig `json:"filters" yaml:"filters"`
}

type OutputConfig

type OutputConfig struct {
	// Output format (json, table, csv)
	Format string `json:"format" yaml:"format"`

	// Pretty print JSON output
	PrettyJSON bool `json:"pretty_json" yaml:"pretty_json"`

	// Include timestamps in output
	IncludeTimestamps bool `json:"include_timestamps" yaml:"include_timestamps"`

	// Output file path (empty for stdout)
	OutputFile string `json:"output_file" yaml:"output_file"`
}

type ParserConfig

type ParserConfig struct {
	StrictMode   bool   `json:"strict_mode" yaml:"strict_mode"`
	MaxQuerySize int    `json:"max_query_size" yaml:"max_query_size"`
	Dialect      string `json:"dialect" yaml:"dialect"`
}

Jump to

Keyboard shortcuts

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