Documentation
¶
Index ¶
- func AutoFixRepository(regex *regexp.Regexp, isDryRun bool) error
- type Branch
- type FileScanner
- type GitHubVCS
- type GitHubWorkFlowScanner
- type GitRepository
- func (g GitRepository) ListBranches() ([]string, error)
- func (g GitRepository) ListFiles(loc string) ([]string, error)
- func (g GitRepository) Location() string
- func (g GitRepository) Name() string
- func (g GitRepository) ReadFile(filePath string) ([]byte, error)
- func (g GitRepository) SwitchBranch(branchName string) error
- type Inventory
- type InventoryRecord
- type Repository
- type Scanner
- type VCS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileScanner ¶
FileScanner defines functionality to scan file content using a regex.
type GitHubVCS ¶
type GitHubVCS struct{}
GitHub VCS
func (GitHubVCS) ListRepositories ¶
func (g GitHubVCS) ListRepositories(root string) ([]Repository, error)
type GitHubWorkFlowScanner ¶
type GitHubWorkFlowScanner struct{}
GitHubWorkFlowScanner implements Scanner interface
func (GitHubWorkFlowScanner) ScanContent ¶
func (gws GitHubWorkFlowScanner) ScanContent(content []byte, regex *regexp.Regexp) ([]string, error)
ScanContent finds matches in given content
type GitRepository ¶
type GitRepository struct {
// contains filtered or unexported fields
}
GitRepository implements Repository interface
func (GitRepository) ListBranches ¶
func (g GitRepository) ListBranches() ([]string, error)
func (GitRepository) Location ¶
func (g GitRepository) Location() string
func (GitRepository) Name ¶
func (g GitRepository) Name() string
func (GitRepository) SwitchBranch ¶
func (g GitRepository) SwitchBranch(branchName string) error
type Inventory ¶
type Inventory struct {
Records []*InventoryRecord `json:"findings"`
}
Inventory aggregates multiple inventory records.
type InventoryRecord ¶
type InventoryRecord struct {
Repository string `json:"repository_name"` // Repository name or path
Branch string `json:"branch_name"` // Branch name
FilePath string `json:"actions_file"` // File path where the match was found
Matches []string `json:"matches"` // Regex match results from the file content
}
InventoryRecord holds details for a regex match in a file.
type Repository ¶
type Repository interface {
Name() string
// Location gets absolute path of repository
Location() string
// ListBranches returns all branches available in the repository.
ListBranches() ([]string, error)
// ReadFile retrieves the content of a file given a file path.
ReadFile(filePath string) ([]byte, error)
// ListFiles returns all file paths under a given directory in a branch.
ListFiles(loc string) ([]string, error)
// SwitchBranch checks out the repository to given branch
SwitchBranch(branchName string) error
}
Repository abstracts a single repository and its operations.
type Scanner ¶
type Scanner struct {
// VCS system implementation (e.g., GitHub, GitLab)
VCS VCS
FileScanner FileScanner
}
Scanner ties together VCS operations with file scanning logic.
func (*Scanner) ScanBranch ¶
func (s *Scanner) ScanBranch(branch string, repo Repository, regex *regexp.Regexp, dirPath string) *InventoryRecord
type VCS ¶
type VCS interface {
ListRepositories(root string) ([]Repository, error)
}
VCS defines operations common to all version control systems.
Click to show internal directories.
Click to hide internal directories.