output

package
v3.0.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchHeads

func BranchHeads(repo *gogit.Repository) (map[string]*object.Commit, error)

BranchHeads creates a map of branch names to their head commit. This can be used to find if a commit is an ancestor of a branch head.

func FindBranch

func FindBranch(commit *object.Commit, repo *gogit.Repository) string

FindBranch returns the first branch a commit is a part of. Not the most accurate, but it should work similar to pre v3.0.

func GenerateDiff

func GenerateDiff(commit *object.Commit, fileName string) string

GenerateDiff will take a commit and create a string diff between the commit and its first parent.

func PrintPlainOutput

func PrintPlainOutput(r *detectors.ResultWithMetadata)

Types

type LegacyJSONCompatibleSource

type LegacyJSONCompatibleSource interface {
	GetCommit() string
	GetFile() string
}

type LegacyJSONOutput

type LegacyJSONOutput struct {
	Branch       string   `json:"branch"`
	Commit       string   `json:"commit"`
	CommitHash   string   `json:"commitHash"`
	Date         string   `json:"date"`
	Diff         string   `json:"diff"`
	Path         string   `json:"path"`
	PrintDiff    string   `json:"printDiff"`
	Reason       string   `json:"reason"`
	StringsFound []string `json:"stringsFound"`
}

func ConvertToLegacyJSON

func ConvertToLegacyJSON(r *detectors.ResultWithMetadata, repoPath string) *LegacyJSONOutput

Jump to

Keyboard shortcuts

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