Help us shape the future of Go! Take the 2026 Go Developer Survey

ingress

package
v0.3.2-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ingress parses repository changes before policy and analysis stages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileChange

type FileChange struct {
	Path    string      `json:"path"`
	OldPath string      `json:"old_path,omitempty"`
	NewFile bool        `json:"new_file,omitempty"`
	Deleted bool        `json:"deleted,omitempty"`
	Ranges  []LineRange `json:"ranges"`
}

FileChange records changed line ranges and file operation metadata.

func ParseUnifiedDiff

func ParseUnifiedDiff(diff string) ([]FileChange, error)

ParseUnifiedDiff extracts new-file line ranges from a unified diff.

type LineRange

type LineRange struct {
	Start int `json:"start"`
	End   int `json:"end"`
}

LineRange is an inclusive range of changed lines in the new file.

type SecretFinding

type SecretFinding struct {
	Kind  string `json:"kind"`
	Line  int    `json:"line"`
	Value string `json:"value"`
}

SecretFinding describes a likely credential in source text.

func ScanSecrets

func ScanSecrets(source []byte) []SecretFinding

ScanSecrets returns concrete credential-pattern hits and high-entropy tokens. The function avoids returning surrounding source context, only the matched value.

func ScanUnifiedDiffSecrets

func ScanUnifiedDiffSecrets(diff string) []SecretFinding

ScanUnifiedDiffSecrets checks added lines only, skipping unified-diff metadata.

Jump to

Keyboard shortcuts

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