git

package
v0.0.0-...-1a4da24 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BBCommitAPIURL

func BBCommitAPIURL(host, source, project, repository, commitid string) (url string)

BBCommitAPIURL formats multiple values into the bitbucket REST API URL

func BBCommitURL

func BBCommitURL(host, source, project, repository, commitid string) (url string)

BBCommitURL formats multiple values into the bitbucket commit URL

func CloneGitRepos

func CloneGitRepos(repoURLs []string, username, password string, branch string, json bool) (tmpDir string, err error)

CloneGitRepos Clones a Git repo into a random temporary folder

func ParseGitLog

func ParseGitLog(r io.Reader) (fileList []scan.File, err error)

ParseGitLog parses the git log into the earlybird file format

func ReposPerProject

func ReposPerProject(projectURL, username, password string) (scanRepos []string)

ReposPerProject returns all the repositories contained within a bitbucket or github project

func ScanDiffs

func ScanDiffs(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanDiffs splits on the diff of an inidividual file

Types

type Diff

type Diff struct {
	Items []DiffItem
	Error error
	// contains filtered or unexported fields
}

Diff is a list of split diffs

func (*Diff) Push

func (d *Diff) Push(s string)

Push a diff on to the list

type DiffItem

type DiffItem struct {
	// contains filtered or unexported fields
}

DiffItem is a diff struct for an inidividual file

func (*DiffItem) GetHashKey

func (d *DiffItem) GetHashKey() string

GetHashKey returns the hash key identifier for the diff

type List

type List interface {
	Push(string)
}

List is an interface for adding items to a list

Jump to

Keyboard shortcuts

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