config

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config provides shared configuration types and validation helpers for pipeleek. This package centralizes common configuration patterns across all platform scanners.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseMaxArtifactSize

func ParseMaxArtifactSize(sizeStr string) (int64, error)

ParseMaxArtifactSize parses a human-readable size string (e.g., "500MB", "1GB") into bytes.

func ValidateThreadCount

func ValidateThreadCount(threads int) error

ValidateThreadCount validates that the thread count is within acceptable bounds.

func ValidateToken

func ValidateToken(token string, fieldName string) error

ValidateToken validates that a token is not empty.

func ValidateURL

func ValidateURL(urlStr string, fieldName string) error

ValidateURL validates that a string is a valid URL.

Types

type CommonScanOptions

type CommonScanOptions struct {
	// ConfidenceFilter filters results by confidence level
	ConfidenceFilter []string
	// MaxScanGoRoutines controls the number of concurrent scanning threads
	MaxScanGoRoutines int
	// TruffleHogVerification enables/disables TruffleHog credential verification
	TruffleHogVerification bool
	// Artifacts enables/disables artifact scanning
	Artifacts bool
	// MaxArtifactSize is the maximum size of artifacts to scan (in bytes)
	MaxArtifactSize int64
	// Owned filters to only owned repositories
	Owned bool
	// HitTimeout is the maximum time to wait for hit detection per scan item
	HitTimeout time.Duration
}

CommonScanOptions contains configuration fields that are shared across all platform scanners. This helps reduce duplication and ensures consistency in option handling.

func DefaultCommonScanOptions

func DefaultCommonScanOptions() CommonScanOptions

DefaultCommonScanOptions returns sensible default values for common scan options.

Jump to

Keyboard shortcuts

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