config

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config provides Leakwatch configuration management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Scan         ScanConfig         `mapstructure:"scan"`
	Detection    DetectionConfig    `mapstructure:"detection"`
	Verification VerificationConfig `mapstructure:"verification"`
	Filter       FilterConfig       `mapstructure:"filter"`
	Output       OutputConfig       `mapstructure:"output"`
	CustomRules  []custom.RuleDef   `mapstructure:"custom-rules"`
}

Config represents the complete application configuration.

func LoadFrom

func LoadFrom(v *viper.Viper) (*Config, error)

LoadFrom reads configuration from a specific Viper instance and returns a validated Config. Each scan command builds its own isolated Viper (see cmd/scan_common.go) and passes it here, which keeps one command's bound flag defaults from leaking into another command's resolved configuration.

type DetectionConfig

type DetectionConfig struct {
	Entropy EntropyConfig `mapstructure:"entropy"`
}

DetectionConfig holds detection configuration.

type EntropyConfig

type EntropyConfig struct {
	Enabled   bool    `mapstructure:"enabled"`
	Threshold float64 `mapstructure:"threshold"`
}

EntropyConfig holds entropy analysis configuration.

type FilterConfig

type FilterConfig struct {
	ExcludePaths     []string `mapstructure:"exclude-paths"`
	ExcludeDetectors []string `mapstructure:"exclude-detectors"`
}

FilterConfig holds filtering configuration.

type OutputConfig

type OutputConfig struct {
	Format            string `mapstructure:"format"`
	File              string `mapstructure:"file"`
	SeverityThreshold string `mapstructure:"severity-threshold"`
	ShowRaw           bool   `mapstructure:"show-raw"`
}

OutputConfig holds output configuration.

type ScanConfig

type ScanConfig struct {
	Concurrency int   `mapstructure:"concurrency"`
	MaxFileSize int64 `mapstructure:"max-file-size"`
}

ScanConfig holds scan engine configuration.

type VerificationConfig

type VerificationConfig struct {
	Enabled     bool          `mapstructure:"enabled"`
	Timeout     time.Duration `mapstructure:"timeout"`
	Concurrency int           `mapstructure:"concurrency"`
	RateLimit   float64       `mapstructure:"rate-limit"`
}

VerificationConfig holds secret verification configuration.

Jump to

Keyboard shortcuts

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