config

package
v0.0.0-...-d4ea3c3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributionConfig

type AttributionConfig struct {
	Mode string `mapstructure:"mode"` // "multi" | "primary" | "first-owner-only"
}

AttributionConfig holds attribution mode configuration

type CacheConfig

type CacheConfig struct {
	Backend    string `mapstructure:"backend"` // "sqlite" | "json"
	SQLitePath string `mapstructure:"sqlite_path"`
	JSONDir    string `mapstructure:"json_dir"`
	TTLMinutes int    `mapstructure:"ttl_minutes"`
}

CacheConfig holds cache configuration

type ConcurrencyConfig

type ConcurrencyConfig struct {
	RepoWorkers int `mapstructure:"repo_workers"`
}

ConcurrencyConfig holds concurrency configuration

type Config

type Config struct {
	GitHub      GitHubConfig       `mapstructure:"github"`
	TimeWindow  TimeWindowConfig   `mapstructure:"time_window"`
	Filters     FiltersConfig      `mapstructure:"filters"`
	Attribution AttributionConfig  `mapstructure:"attribution"`
	Cache       CacheConfig        `mapstructure:"cache"`
	RateLimiter RateLimiterConfig  `mapstructure:"rate_limiter"`
	Output      OutputConfig       `mapstructure:"output"`
	Logging     LoggingConfig      `mapstructure:"logging"`
	Concurrency ConcurrencyConfig  `mapstructure:"concurrency"`
	TeamRollup  []TeamRollupConfig `mapstructure:"team_rollup"`
}

Config holds the application configuration

func LoadConfig

func LoadConfig(configPath string, logger *zap.Logger) (*Config, error)

LoadConfig loads configuration from file and environment

func (*Config) GetTimeWindow

func (c *Config) GetTimeWindow() (time.Time, time.Time, error)

GetTimeWindow returns parsed time window

func (*Config) GetToken

func (c *Config) GetToken() (string, error)

GetToken retrieves the GitHub token from environment

type FiltersConfig

type FiltersConfig struct {
	ExcludeAuthors       []string `mapstructure:"exclude_authors"`
	ExcludeTitlePrefixes []string `mapstructure:"exclude_title_prefixes"`
}

FiltersConfig holds filter configuration

type GitHubConfig

type GitHubConfig struct {
	Org         string `mapstructure:"org"`
	TokenEnvVar string `mapstructure:"token_env_var"`
}

GitHubConfig holds GitHub API configuration

type LoggingConfig

type LoggingConfig struct {
	Level string `mapstructure:"level"` // "debug" | "info" | "warn" | "error"
}

LoggingConfig holds logging configuration

type OutputConfig

type OutputConfig struct {
	Format    string `mapstructure:"format"` // "json" | "csv"
	OutputDir string `mapstructure:"output_dir"`
}

OutputConfig holds output configuration

type RateLimiterConfig

type RateLimiterConfig struct {
	Type         string      `mapstructure:"type"` // "token-bucket"
	QPS          int         `mapstructure:"qps"`
	Burst        int         `mapstructure:"burst"`
	Retry        RetryConfig `mapstructure:"retry"`
	Threshold    int         `mapstructure:"threshold"`     // Rate limit threshold to trigger sleep
	SleepMinutes int         `mapstructure:"sleep_minutes"` // Minutes to sleep when threshold is reached
}

RateLimiterConfig holds rate limiter configuration

type RetryConfig

type RetryConfig struct {
	MaxAttempts int `mapstructure:"max_attempts"`
	BaseDelayMs int `mapstructure:"base_delay_ms"`
}

RetryConfig holds retry configuration

type TeamRollupConfig

type TeamRollupConfig struct {
	Name  string   `mapstructure:"name"`
	Teams []string `mapstructure:"teams"`
}

TeamRollupConfig holds team rollup configuration

type TimeWindowConfig

type TimeWindowConfig struct {
	Since string `mapstructure:"since"`
	Until string `mapstructure:"until"`
}

TimeWindowConfig holds the time window for PR analysis

Jump to

Keyboard shortcuts

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