config

package
v0.26.12 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ArchivePublishDelay = 2 * time.Hour

ArchivePublishDelay is the expected lag between an hour ending and GH Archive publishing the corresponding file (~2 hours).

Variables

This section is empty.

Functions

func CrossVCSTTL

func CrossVCSTTL() time.Duration

CrossVCSTTL returns the freshness window for cached cross-VCS match summaries. Override via DEVTRACE_CROSS_VCS_TTL.

func CrossVCSTimeout

func CrossVCSTimeout() time.Duration

CrossVCSTimeout returns the per-call timeout for the forges client. Override via DEVTRACE_CROSS_VCS_TIMEOUT.

func DebugEnabled

func DebugEnabled() bool

func GetEnv

func GetEnv(key, fallback string) string

func GetEnvAsDuration

func GetEnvAsDuration(key string, fallback time.Duration) time.Duration

GetEnvAsDuration parses the env var as a Go duration; falls back to the default on absent or invalid values.

func GetEnvAsFloat

func GetEnvAsFloat(key string, fallback float64) float64

func GetEnvAsInt

func GetEnvAsInt(key string, fallback int) int

func GetEnvBool

func GetEnvBool(key string) bool

func GetEnvBoolDefault

func GetEnvBoolDefault(key string, fallback bool) bool

GetEnvBoolDefault returns the env var as a bool, falling back to the provided default when unset. Use this for feature flags that default to ON (operator must opt out) rather than the default-OFF GetEnvBool. Accepted truthy/falsy values are the standard pairs: "true"/"false" and "1"/"0", case-insensitive.

func OSSFTTL

func OSSFTTL() time.Duration

OSSFTTL returns the freshness window for cached OSSF Scorecard rows. Override via DEVTRACE_OSSF_TTL.

func OSSFTimeout

func OSSFTimeout() time.Duration

OSSFTimeout returns the per-call timeout for the OSSF Scorecard HTTP client. Override via DEVTRACE_OSSF_TIMEOUT.

func PublisherTTL

func PublisherTTL() time.Duration

PublisherTTL returns the freshness window for cached publisher profiles. Override via DEVTRACE_PUBLISHER_TTL.

func PublisherTimeout

func PublisherTimeout() time.Duration

PublisherTimeout returns the per-call timeout for the publisher HTTP clients. Override via DEVTRACE_PUBLISHER_TIMEOUT.

func PublisherTopLimit

func PublisherTopLimit() int

PublisherTopLimit returns the cap on packages surfaced in the top list. Override via DEVTRACE_PUBLISHER_TOP_LIMIT.

func RepoListLimit

func RepoListLimit() int

RepoListLimit returns the cap on how many of a contributor's repositories the owned-repos aggregator pulls from GitHub on a single refresh. Override via DEVTRACE_REPO_LIST_LIMIT. Three pages of 100 covers nearly all real users; high-volume accounts get the most-recently-pushed slice.

func RepoSummaryTTL

func RepoSummaryTTL() time.Duration

RepoSummaryTTL returns the freshness window for cached owned-repos aggregates. Override via DEVTRACE_REPO_SUMMARY_TTL (Go duration format, e.g. "12h", "30m"). Beyond this age the next score request triggers a re-fetch from the GitHub /users/{u}/repos endpoint.

func SecurityCreditLimit

func SecurityCreditLimit() int

SecurityCreditLimit returns the cap on how many GHSA credits the security-advisory fetcher pulls from GitHub on a single refresh. Override via DEVTRACE_SECURITY_CREDIT_LIMIT.

func SecurityCreditTTL

func SecurityCreditTTL() time.Duration

SecurityCreditTTL returns the freshness window for cached GHSA security-advisory credits. Override via DEVTRACE_SECURITY_CREDIT_TTL.

func SecurityCreditsEnabled

func SecurityCreditsEnabled() bool

SecurityCreditsEnabled gates live GHSA-credit fetching. Defaults OFF because the v0.21 GraphQL query (User.securityAdvisoryCredits) hits a non-existent field and there is no cheap alternative API yet. Flip via DEVTRACE_SECURITY_CREDITS_ENABLED=true once a viable fetch path exists. The cache lookup and UI render still run when disabled, so pre-existing rows surface and re-enabling is a no-op for callers.

func StackOverflowAPIKey

func StackOverflowAPIKey() string

StackOverflowAPIKey returns the optional Stack Exchange API key. Empty string runs against the unauthenticated 300/day per-IP quota; providing a key (DEVTRACE_SO_API_KEY) lifts that to 10000/day.

func StackOverflowTTL

func StackOverflowTTL() time.Duration

StackOverflowTTL returns the freshness window for cached SO profiles. Override via DEVTRACE_SO_TTL.

func StackOverflowTimeout

func StackOverflowTimeout() time.Duration

StackOverflowTimeout returns the per-call timeout for the SE Data API client. Override via DEVTRACE_SO_TIMEOUT.

Types

This section is empty.

Jump to

Keyboard shortcuts

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