Documentation ¶
Index ¶
- Constants
- func Start(gs *GSArgs)
- type AuditReport
- type BranchSearchOptions
- type GSArgs
- type GitBranch
- func (branch *GitBranch) Search()
- func (branch *GitBranch) SearchInFile(searchString string, c *object.Commit) (bool, []string, []string)
- func (branch *GitBranch) SearchInPatch(searchString string, p *object.Patch) (bool, []string, []string)
- func (branch *GitBranch) SetSearchOpts(gitRepo *GitRepository) bool
- type GitRepository
- type RepoSearchOptions
- type RuleSet
- type SafeCounter
- type SearchDetails
Constants ¶
const ( //CloneDir is the temporary directory name used while //Checking out git repository CloneDir = "gitaudit-" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuditReport ¶
type AuditReport struct { RuleName string `json:"rulename"` Rule string `json:"rule"` Branch string `json:"branch"` Hash string `json:"hash"` Time string `json:"time"` Committer string `json:"committer"` FilePath string `json:"file"` Match string `json:"match"` }
AuditReport contains reporting fields to be
type BranchSearchOptions ¶
BranchSearchOptions has the search options for each branch
type GSArgs ¶
type GSArgs struct {
// contains filtered or unexported fields
}
GSArgs used to store arguments received from the user
type GitBranch ¶
type GitBranch struct {
// contains filtered or unexported fields
}
GitBranch contains details about branch and its search options
func (*GitBranch) Search ¶
func (branch *GitBranch) Search()
Search searches as per the rules through all commit differences
func (*GitBranch) SearchInFile ¶
func (branch *GitBranch) SearchInFile(searchString string, c *object.Commit) (bool, []string, []string)
SearchInFile searches the searchString in file , if a match is found we will just come out. searchString can be a regular experssion
func (*GitBranch) SearchInPatch ¶
func (branch *GitBranch) SearchInPatch(searchString string, p *object.Patch) (bool, []string, []string)
SearchInPatch searches the searchString in patch , if a match is found we will just come out. searchString can be a regular experssion
func (*GitBranch) SetSearchOpts ¶
func (branch *GitBranch) SetSearchOpts(gitRepo *GitRepository) bool
SetSearchOpts sets the branch search options
type GitRepository ¶
type GitRepository struct { SearchOpts []BranchSearchOptions // contains filtered or unexported fields }
GitRepository has the details about the repository to be searched and search options
func (*GitRepository) CloneRepo ¶
func (gitRepo *GitRepository) CloneRepo(repoURL string) error
CloneRepo clones the repository
func (*GitRepository) Search ¶
func (gitRepo *GitRepository) Search()
Search starts the search in gitrepo
type RepoSearchOptions ¶
type RepoSearchOptions struct {
BranchSearchOptions []BranchSearchOptions `json:"repository"`
}
RepoSearchOptions contains
func GetSearchOptions ¶
func GetSearchOptions(searchOptFile string) (*RepoSearchOptions, error)
GetSearchOptions gets the search options from the seachoption file
type SafeCounter ¶
type SafeCounter struct {
// contains filtered or unexported fields
}
SafeCounter is safe to use concurrently.
func (*SafeCounter) GetViolationCount ¶
func (c *SafeCounter) GetViolationCount() int
GetViolationCount returns the no of Violations
type SearchDetails ¶
type SearchDetails struct {
// contains filtered or unexported fields
}
SearchDetails contains search details