Documentation
¶
Index ¶
- func DetectConfigPath(repoRoot string) string
- func GetPlatform() string
- type BinaryManager
- type GitleaksFinding
- type Scanner
- func (s *Scanner) Detectors() ([]string, error)
- func (s *Scanner) Scan(path string, data []byte) ([]types.Finding, error)
- func (s *Scanner) ScanBatch(inputs []scanner.BatchInput) ([]types.Finding, error)
- func (s *Scanner) ScanWithContext(ctx scanner.ScanContext, data []byte) ([]types.Finding, error)
- func (s *Scanner) Version() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectConfigPath ¶
func GetPlatform ¶
func GetPlatform() string
GetPlatform returns the platform identifier for Gitleaks releases.
Types ¶
type BinaryManager ¶
type BinaryManager struct {
// contains filtered or unexported fields
}
BinaryManager handles detection and installation of the Gitleaks binary.
func NewBinaryManager ¶
func NewBinaryManager(customPath string) *BinaryManager
NewBinaryManager creates a new binary manager.
func (*BinaryManager) Download ¶
func (bm *BinaryManager) Download(version string) (string, error)
Download fetches the requested version (or latest) and stores it in the cache.
func (*BinaryManager) Find ¶
func (bm *BinaryManager) Find(expectedVersion string) (string, error)
Find locates a Gitleaks binary honoring an expected version (when provided). Search order:
- Custom path (if configured)
- $PATH
- Versioned cache (~/.redactyl/bin/gitleaks-<version>)
- Legacy cache (~/.redactyl/bin/gitleaks)
type GitleaksFinding ¶
type GitleaksFinding struct {
Description string `json:"Description"`
RuleID string `json:"RuleID"`
Match string `json:"Match"`
Secret string `json:"Secret"`
StartLine int `json:"StartLine"`
EndLine int `json:"EndLine"`
StartColumn int `json:"StartColumn"`
EndColumn int `json:"EndColumn"`
File string `json:"File"`
Commit string `json:"Commit"`
Entropy float64 `json:"Entropy,omitempty"`
Author string `json:"Author,omitempty"`
Email string `json:"Email,omitempty"`
Date string `json:"Date,omitempty"`
Message string `json:"Message,omitempty"`
Tags []string `json:"Tags,omitempty"`
Fingerprint string `json:"Fingerprint,omitempty"`
}
GitleaksFinding represents Gitleaks JSON output format.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner implements the scanner.Scanner interface using Gitleaks.
func NewScanner ¶
func NewScanner(cfg config.GitleaksConfig) (*Scanner, error)
NewScanner creates a new Gitleaks scanner from configuration.
func (*Scanner) ScanBatch ¶
ScanBatch implements scanner.Scanner by scanning multiple inputs in a single gitleaks invocation.
func (*Scanner) ScanWithContext ¶
ScanWithContext implements scanner.Scanner with artifact context.