config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSince           = 24 * time.Hour
	DefaultLimit           = 25
	MaxFeedLimit           = 1000
	DefaultGitHubRepoLimit = 100
	// DefaultGitHubRepoLimitUnauth caps org/user scans when no GitHub token is
	// set. Unauthenticated GitHub REST allows only ~60 requests/hour per IP, and
	// each repo costs roughly one SBOM request, so the default cap is kept low to
	// avoid exhausting the budget (and tripping rate-limit backoff) in one run.
	DefaultGitHubRepoLimitUnauth = 10
	MaxGitHubRepoLimit           = 1000
	DefaultTimeout               = 30 * time.Second
	DefaultCacheTTL              = 30 * time.Minute
)

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

func NormalizeFeedLimit

func NormalizeFeedLimit(limit, fallback int) (int, error)

NormalizeFeedLimit resolves CLI/config feed limits and rejects invalid values.

func NormalizeGitHubRepoLimit

func NormalizeGitHubRepoLimit(limit int, authenticated bool) (int, error)

NormalizeGitHubRepoLimit resolves org/user repo list limits for depx github. When the user did not specify a limit, the default depends on authentication: unauthenticated scans use a much lower cap to stay within GitHub's ~60 req/hr budget. An explicit limit is always honored (up to MaxGitHubRepoLimit).

Types

type Config

type Config struct {
	DefaultEcosystem string        `yaml:"default_ecosystem"`
	Timeout          time.Duration `yaml:"timeout"`
	CacheDir         string        `yaml:"cache_dir"`
	Feed             FeedConfig    `yaml:"feed"`
	Sources          []string      `yaml:"sources"`
	Output           OutputConfig  `yaml:"output"`
}

func Default

func Default() *Config

func Load

func Load(path string) (*Config, error)

type FeedConfig

type FeedConfig struct {
	Since    time.Duration `yaml:"since"`
	Limit    int           `yaml:"limit"`
	CacheTTL time.Duration `yaml:"cache_ttl"`
}

type OutputConfig

type OutputConfig struct {
	Color bool `yaml:"color"`
}

Jump to

Keyboard shortcuts

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