Documentation
¶
Index ¶
- func IsYAMLFile(path string) bool
- func ParseYAML(data []byte, sourcePath string) ([]*index.ResourceEntry, error)
- func ParseYAMLFile(path string) ([]*index.ResourceEntry, error)
- func ScanRepository(repoPath string) (*index.Index, error)
- func ScanRepositoryWithOptions(repoPath string, opts ScanOptions) (*index.Index, error)
- func ValidateResource(entry *index.ResourceEntry) error
- type FileFilter
- type ScanOptions
- type Scanner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsYAMLFile ¶
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 ¶
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 ¶
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