Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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, 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 )
type UpstreamLister ¶ added in v0.6.0
type UpstreamLister interface {
List(ctx context.Context, mod string) (*storage.RevInfo, []string, error)
}
UpstreamLister retrieves a list of available module versions from upstream i.e. VCS, and a Storage backend.
func NewVCSLister ¶ added in v0.6.0
func NewVCSLister(goBinPath string, env []string, fs afero.Fs) UpstreamLister
NewVCSLister creates an UpstreamLister which uses VCS to fetch a list of available versions.