scanner

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsYAMLFile

func IsYAMLFile(path string) bool

IsYAMLFile checks if a file has a YAML extension

func ParseYAML

func ParseYAML(data []byte, sourcePath string) ([]*index.ResourceEntry, error)

ParseYAML parses YAML data and returns all resources found

func ParseYAMLFile

func ParseYAMLFile(path string) ([]*index.ResourceEntry, error)

ParseYAMLFile parses a YAML file and returns all resources found in it Supports multi-document YAML files (separated by ---)

func ScanRepository

func ScanRepository(repoPath string) (*index.Index, error)

ScanRepository is a convenience function to scan a repository with default options

func ScanRepositoryWithOptions

func ScanRepositoryWithOptions(repoPath string, opts ScanOptions) (*index.Index, error)

ScanRepositoryWithOptions scans a repository with custom options

func ValidateResource

func ValidateResource(entry *index.ResourceEntry) error

ValidateResource checks if a resource is valid for indexing

Types

type FileFilter

type FileFilter struct {
	ExcludePaths []string
	IncludeExts  []string
}

FileFilter determines which files should be scanned

func DefaultFilter

func DefaultFilter() *FileFilter

DefaultFilter returns a filter with sensible defaults for GitOps repos

func (*FileFilter) ShouldDescendIntoDir

func (f *FileFilter) ShouldDescendIntoDir(dirName string) bool

ShouldDescendIntoDir determines if a directory should be traversed

func (*FileFilter) ShouldScan

func (f *FileFilter) ShouldScan(path string) bool

ShouldScan determines if a file should be scanned

type ScanOptions

type ScanOptions struct {
	Workers      int
	Filter       *FileFilter
	Verbose      bool
	ErrorHandler func(path string, err error)
}

ScanOptions configures the scanner behavior

func DefaultScanOptions

func DefaultScanOptions() ScanOptions

DefaultScanOptions returns default scanning options

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner handles repository scanning

func New

func New(opts ScanOptions) *Scanner

New creates a new scanner with the given options

func (*Scanner) Scan

func (s *Scanner) Scan(repoPath string) (*index.Index, error)

Scan scans a repository and builds an index

Jump to

Keyboard shortcuts

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