Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearFiles ¶ added in v0.1.0
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
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
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter is a filter of modules
func NewFilter ¶
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, versions []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 )