module

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MIT Imports: 16 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearFiles added in v0.1.0

func ClearFiles(fs afero.Fs, root string) error

ClearFiles deletes all data from the given fs at path root This function must be called when zip is closed to cleanup the entire GOPATH created by the diskref

func PrepareEnv added in v0.1.0

func PrepareEnv(gopath string) []string

PrepareEnv will return all the appropriate environment variables for a Go Command to run successfully (such as GOPATH, GOCACHE, PATH etc)

Types

type Fetcher

type Fetcher interface {
	// Fetch downloads the sources from an upstream and returns the corresponding
	// .info, .mod, and .zip files.
	Fetch(ctx context.Context, mod, ver string) (*storage.Version, error)
}

Fetcher fetches module from an upstream source

func NewGoGetFetcher

func NewGoGetFetcher(goBinaryName string, fs afero.Fs) (Fetcher, error)

NewGoGetFetcher creates fetcher which uses go get tool to fetch modules

type Filter

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

Filter is a filter of modules

func NewFilter

func NewFilter(filterFilePath string) (*Filter, error)

NewFilter creates new filter based on rules defined in a configuration file WARNING: this is not concurrently safe Configuration consists of two operations: + for include and - for exclude e.g.

  • github.com/a
  • github.com/a/b

will communicate all modules except github.com/a and its children, but github.com/a/b will be communicated example 2:

-
+ github.com/a

will exclude all items from communication except github.com/a

func (*Filter) AddRule

func (f *Filter) AddRule(path string, qualifiers []string, rule FilterRule)

AddRule adds rule for specified path

func (*Filter) Rule added in v0.1.0

func (f *Filter) Rule(path, version string) FilterRule

Rule returns the filter rule to be applied to the given path

type FilterRule

type FilterRule int

FilterRule defines behavior of module communication

const (
	// Default filter rule does not alter default/parent behavior
	Default FilterRule = iota
	// Include treats modules the usual way
	// Used for reverting Exclude of parent path
	Include
	// Exclude filter rule excludes package and its children from communication
	Exclude
	// Direct filter rule forces the package to be fetched directly from upstream proxy
	Direct
)

Jump to

Keyboard shortcuts

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