git

package
v0.0.0-...-4673371 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: EUPL-1.2 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultIgnoreFileNames

func GetDefaultIgnoreFileNames() []string

Types

type BatchItem

type BatchItem struct {
	Commit *object.Commit
	Parent *object.Commit
}

type FileScanner

type FileScanner interface {
	ExtractFromReader(ctx context.Context, fileName string, rd io.Reader) ([]file.ExtractResult, error)
	ExtractFromLine(ctx context.Context, fileName string, lineNumber int, line string, previousLines string) ([]file.ExtractResult, error)
}

type GitResult

type GitResult struct {
	Commit   *object.Commit
	FileName string
	Results  []file.ExtractResult
}

type GitScan

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

func New

func New(repoUrl string, fileScanner FileScanner, options ...Option) (*GitScan, error)

func NewFromRepo

func NewFromRepo(repository *gitgo.Repository, fileScanner FileScanner, options ...Option) (*GitScan, error)

func (*GitScan) Scan

func (scanner *GitScan) Scan(ctx context.Context) error

type Option

type Option func(*options) error

func WithCallbackResult

func WithCallbackResult(f func(ctx context.Context, scanner *GitScan, result *GitResult) error) Option

func WithCredentials

func WithCredentials(creds transport.AuthMethod) Option

func WithFileScannerOptions

func WithFileScannerOptions(opts ...file.Option) Option

func WithIgnoreFileNames

func WithIgnoreFileNames(useDefault bool, names ...string) Option

func WithProbability

func WithProbability(probability float64) Option

func WithSkipCommitFunc

func WithSkipCommitFunc(f func(batch []BatchItem) ([]BatchItem, error)) Option

Jump to

Keyboard shortcuts

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