scanner

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpConfig

func DumpConfig(config *Config) error

func GitStatus

func GitStatus(d string) (git.Status, error)

GitStatus invokes git executable to determine the git status for a directory

func GoGitStatus

func GoGitStatus(d string) (git.Status, error)

GoGitStatus uses go-git package to determine the git status for a directory

func Walk

func Walk(ctx context.Context, config *Config, results chan string) error

Walk finds all git repositories in the directories specified in config

Types

type Config

type Config struct {
	ScanDirs struct {
		Include []string `yaml:"include"`
		Exclude []string `yaml:"exclude"`
	} `yaml:"scandirs"`
	GitIgnore struct {
		FileGlob []string `yaml:"fileglob"`
		DirGlob  []string `yaml:"dirglob"`
	} `yaml:"gitignore"`
	FollowSymlinks bool `yaml:"followsymlinks"`
}

func ParseConfigFile

func ParseConfigFile(filename string) (*Config, error)

type Excluder

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

func NewExcluder

func NewExcluder(files, dirs []string) (Excluder, error)

func (Excluder) FilterGitStatus

func (e Excluder) FilterGitStatus(st git.Status) git.Status

func (Excluder) IsExcluded

func (e Excluder) IsExcluded(path string) bool

type MultiGitStatus

type MultiGitStatus map[string]RepoStatus

func Scan

func Scan(config *Config) (MultiGitStatus, error)

Scan finds all "dirty" git repositories specified by config

type RepoStatus

type RepoStatus struct {
	git.Status

	ScanTime time.Duration
}

Jump to

Keyboard shortcuts

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