scan

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegexMatched

func RegexMatched(f interface{}, re *regexp.Regexp) bool

RegexMatched matched an interface to a regular expression. The interface f can be a string type or go-git *object.File type.

func Run

func Run(m *manager.Manager) error

Run accepts a manager and begins an scan based on the options/configs set in the manager.

Types

type Bundle

type Bundle struct {
	Commit    *object.Commit
	Patch     string
	Content   string
	FilePath  string
	Operation fdiff.Operation
	// contains filtered or unexported fields
}

Bundle contains various git information for scans.

type Repo

type Repo struct {
	*git.Repository

	Name    string
	Manager *manager.Manager
	// contains filtered or unexported fields
}

Repo wraps a *git.Repository object in addition to a manager object and the name of the repo. Commits are inspected from the *git.Repository object. If a Commit is found then we send it via the manager LeakChan where the manager receives and keeps track of all leaks.

func NewRepo

func NewRepo(m *manager.Manager) *Repo

NewRepo initializes and returns a Repo struct.

func (*Repo) CheckRules

func (repo *Repo) CheckRules(bundle *Bundle)

CheckRules accepts bundle and checks each rule defined in the config against the bundle's content.

func (*Repo) Clone

func (repo *Repo) Clone(cloneOption *git.CloneOptions) error

Clone will clone a repo and return a Repo struct which contains a go-git repo. The clone method is determined by the clone options set in Manager.metadata.cloneOptions

func (*Repo) Open

func (repo *Repo) Open() error

Open opens a local repo either from repo-path or $PWD

func (*Repo) Scan

func (repo *Repo) Scan() error

Scan is responsible for scanning the entire history (default behavior) of a git repo. Options that can change the behavior of this function include: --Commit, --depth, --branch. See options/options.go for an explanation on these options.

Jump to

Keyboard shortcuts

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