patrol

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

type Package struct {
	Name         string
	PartOfModule bool
	Dependants   []*Package
	Changed      bool
}

type Repo

type Repo struct {
	Module *modfile.File

	// map of packages, with the package name as key (e.g.:
	// github.com/uw-labs/patrol/patrol)
	Packages map[string]*Package
	// contains filtered or unexported fields
}

func NewRepo

func NewRepo(path string) (*Repo, error)

NewRepo constructs a Repo from path, which needs to contain a go.mod file. It builds a map of all packages found in that repo and the dependencies between them.

func (*Repo) ChangesFrom

func (r *Repo) ChangesFrom(revision string, allChanges bool) ([]string, error)

ChangesFrom returns a list of all packages within the repository (excluding packages in vendor/) that changed since the given revision. A package will be flagged as change if any file within the package itself changed or if any packages it imports (whether local, vendored or external modules) changed since the given revision. If allChanges is false it will be only concerned about changes in .go files.

func (*Repo) ModuleName

func (r *Repo) ModuleName() string

func (*Repo) OwnsPackage

func (r *Repo) OwnsPackage(pkgName string) bool

Jump to

Keyboard shortcuts

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