config

package
v0.46.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminRequireIAM added in v0.41.0

func AdminRequireIAM() bool

AdminRequireIAM returns true if the admin server should verify Cloud Run IAM auth headers are present on every request (defense-in-depth). Override: ADMIN_REQUIRE_IAM (default true). Set to "false" for local dev.

func AnthropicAPIKey added in v0.30.8

func AnthropicAPIKey() string

AnthropicAPIKey returns the Anthropic API key (empty if not configured).

func AnthropicBaseURL added in v0.30.8

func AnthropicBaseURL() string

AnthropicBaseURL returns the optional Anthropic base URL override.

func AnthropicModel added in v0.30.8

func AnthropicModel(defaultModel string) string

AnthropicModel returns the Anthropic model for the given default. Both import insights and metrics review read ANTHROPIC_MODEL but use different defaults (haiku for high-volume insights, sonnet for review). Override: ANTHROPIC_MODEL.

func BackfillMaxDays added in v0.30.5

func BackfillMaxDays() int

BackfillMaxDays returns the PR size backfill lookback window in days. Override: BACKFILL_MAX_DAYS (default 90).

func CloudRunExecution added in v0.30.8

func CloudRunExecution() string

CloudRunExecution returns the Cloud Run execution ID, or a local fallback. Override: CLOUD_RUN_EXECUTION.

func CloudRunTaskCount added in v0.33.0

func CloudRunTaskCount() int

CloudRunTaskCount returns the total number of tasks in the job execution. Override: CLOUD_RUN_TASK_COUNT (default 1 for local/single-task runs).

func CloudRunTaskIndex added in v0.33.0

func CloudRunTaskIndex() int

CloudRunTaskIndex returns the 0-based task index within the job execution. Override: CLOUD_RUN_TASK_INDEX (default 0 for local/single-task runs).

func DBInstanceID added in v0.45.0

func DBInstanceID() string

DBInstanceID returns the Cloud SQL instance identifier for monitoring filters. Override: DB_INSTANCE_ID (default "thingzio-pg").

func DBMaxIdleConns added in v0.30.8

func DBMaxIdleConns(poolDefault int) int

DBMaxIdleConns returns the max idle database connections. Override: DB_MAX_IDLE_CONNS. Caller supplies the per-pool default.

func DBMaxOpenConns added in v0.30.8

func DBMaxOpenConns(poolDefault int) int

DBMaxOpenConns returns the max open database connections. Override: DB_MAX_OPEN_CONNS. Caller supplies the per-pool default.

func DebugEnabled added in v0.30.8

func DebugEnabled() bool

DebugEnabled returns true if debug logging is enabled. Override: DEVPULSE_DEBUG=true|1.

func DeepRepHighScoreStaleHours added in v0.37.0

func DeepRepHighScoreStaleHours() int

DeepRepHighScoreStaleHours returns the rescore interval for contributors with reputation at or above the score threshold. Override: DEEPREP_HIGH_STALE_HOURS (default 720 = 30 days).

func DeepRepImportLimit added in v0.46.1

func DeepRepImportLimit() int

DeepRepImportLimit returns the max developers scored per repo during import. Dedicated deep reputation worker handles the full set. Override: DEEPREP_IMPORT_LIMIT (default 100).

func DeepRepLowScoreStaleHours added in v0.37.0

func DeepRepLowScoreStaleHours() int

DeepRepLowScoreStaleHours returns the rescore interval for contributors with reputation below the score threshold. Override: DEEPREP_LOW_STALE_HOURS (default 168 = 7 days).

func DeepRepScoreThreshold added in v0.37.0

func DeepRepScoreThreshold() float64

DeepRepScoreThreshold returns the reputation score boundary between low and high rescore tiers. Override: DEEPREP_SCORE_THRESHOLD (default 0.5).

func GCPProjectID added in v0.30.8

func GCPProjectID() string

GCPProjectID returns the GCP project ID. Override: GCP_PROJECT_ID (default "thingzio").

func GetEnv

func GetEnv(key, defaultValue string) string

GetEnv retrieves the value of the environment variable named by the key. If the variable is present in the environment, its value is returned. Otherwise, the provided defaultValue is returned.

func GetEnvAsFloat added in v0.37.0

func GetEnvAsFloat(key string, defaultValue float64) float64

GetEnvAsFloat retrieves the value of the environment variable and converts it to a float64. Returns defaultValue if unset or invalid.

func GetEnvAsInt added in v0.30.8

func GetEnvAsInt(key string, defaultValue int) int

GetEnvAsInt retrieves the value of the environment variable named by the key and converts it to an integer. Returns defaultValue if unset or non-positive.

func GetEnvAsIntNonNeg added in v0.33.0

func GetEnvAsIntNonNeg(key string, defaultValue int) int

GetEnvAsIntNonNeg retrieves the value of the environment variable and converts it to a non-negative integer. Returns defaultValue if unset or negative.

func GetEnvBool added in v0.30.8

func GetEnvBool(key string) bool

GetEnvBool returns true if the environment variable is set to "true" or "1".

func HTTPMaxIdleConns added in v0.41.0

func HTTPMaxIdleConns() int

HTTPMaxIdleConns returns the max idle connections for the shared HTTP transport. Override: HTTP_MAX_IDLE_CONNS (default 50).

func HTTPMaxIdleConnsPerHost added in v0.41.0

func HTTPMaxIdleConnsPerHost() int

HTTPMaxIdleConnsPerHost returns the max idle connections per host. Override: HTTP_MAX_IDLE_CONNS_PER_HOST (default 10).

func ImportAdoptTimeout added in v0.40.0

func ImportAdoptTimeout() int

ImportAdoptTimeout returns the minutes before a new repo (import_done_at IS NULL) is adopted by the scheduled import as a safety net. Override: IMPORT_ADOPT_TIMEOUT (default 60).

func ImportBackfillChunkDays added in v0.46.0

func ImportBackfillChunkDays() int

ImportBackfillChunkDays returns the backfill chunk size in days. Override: IMPORT_BACKFILL_CHUNK_DAYS (default 7).

func ImportDBBatchSize added in v0.46.0

func ImportDBBatchSize() int

ImportDBBatchSize returns the number of events per DB transaction during flush. Override: IMPORT_DB_BATCH_SIZE (default 100).

func ImportFreshDays added in v0.46.0

func ImportFreshDays() int

ImportFreshDays returns the fresh pass lookback window in days. Override: IMPORT_FRESH_DAYS (default 21).

func ImportJobName added in v0.40.0

func ImportJobName() string

ImportJobName returns the fully-qualified Cloud Run import job name for triggering on-demand imports. Override: IMPORT_JOB_NAME (default "").

func ImportOrg added in v0.40.0

func ImportOrg() string

ImportOrg returns the org for single-repo import mode. Override: IMPORT_ORG (default "").

func ImportRepo added in v0.40.0

func ImportRepo() string

ImportRepo returns the repo for single-repo import mode. Override: IMPORT_REPO (default "").

func ImportTaskTimeout added in v0.33.0

func ImportTaskTimeout() int

ImportTaskTimeout returns the per-task timeout in minutes. Override: IMPORT_TASK_TIMEOUT (default 55).

func ImportWorkers added in v0.33.0

func ImportWorkers() int

ImportWorkers returns the number of concurrent goroutine workers per task. Override: IMPORT_WORKERS (default 2).

func OAuthRateLimit added in v0.41.0

func OAuthRateLimit() int

OAuthRateLimit returns the max OAuth requests per minute per IP. Override: OAUTH_RATE_LIMIT (default 20).

func QueryParamMaxDays added in v0.41.0

func QueryParamMaxDays() int

QueryParamMaxDays returns the maximum allowed value for the days query parameter. Override: QUERY_PARAM_MAX_DAYS (default 3650).

func QueryParamMinDays added in v0.41.0

func QueryParamMinDays() int

QueryParamMinDays returns the minimum allowed value for the days query parameter. Override: QUERY_PARAM_MIN_DAYS (default 14).

func RepoSearchRateLimit added in v0.41.0

func RepoSearchRateLimit() int

RepoSearchRateLimit returns the max repo-search requests per minute per IP. Override: REPO_SEARCH_RATE_LIMIT (default 30).

func ServerShutdownTimeout added in v0.41.0

func ServerShutdownTimeout() int

ServerShutdownTimeout returns the graceful shutdown timeout. Override: SERVER_SHUTDOWN_TIMEOUT_SEC (default 5).

func ServerTriggerTimeout added in v0.41.0

func ServerTriggerTimeout() int

ServerTriggerTimeout returns the timeout for fire-and-forget import triggers. Override: SERVER_TRIGGER_TIMEOUT_SEC (default 30).

Types

This section is empty.

Jump to

Keyboard shortcuts

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