mirror of
https://github.com/gomods/athens
synced 2026-02-03 14:20:31 +00:00
* add module fetch and fetchers
* Breaking module ref out of the fetcher
* disk ref in progress
* very broken go get fetcher
* refactoring ref and fixing up the disk ref
* adding a test for the disk ref
* doing test setup right
* passing version
* fixing syntax err
* removing raw format string
in favor of a function that does the same thing
* removing obsolete godoc
* removing the switch in favor of nested if statements
hopefully this is easier to read
* passing data into the format strings
* refactoring the closer
* creating and looking for files in the root
* genericFetcher => goGetFetcher
* remove the clear method on go get fetcher
the ref returned from fetch does it
* remove unnecessary call to isVgoInstalled
calls to fetch will fail if vgo is not installed
* remove unneeded dirName
* adding preliminary test for the go get fetcher
* adding a test for fetch
* executing fetch test
* adding docs and simplifying the fetcher
* declaring the storage version up front
* fixing the source path
* creating test files in a separate function
* closing files immediately
instead of aggregating them for later. whaaat was I thinking???
* passing context into storage driver
* not closing the source file
* not putting the module name in quotes anymore
* adding a warning about deleting the package
* adding go binary name
* embedding github API limit error
* check files in the success path
* passing errors up
not just messages
* doh
* using vgo for the go get fetcher tests
* not using multierror because it's unneeded
* less code 😄
* custom error
* removing unused import
* return noop refs
* adding link to issue for the TODO
* simplifying
* simplifying moar!
* using config.FmtModVer
* simplifying
* defer closing the zip
* closing the zip
* adding comment about closing the ver.Zip
* GO_BINARY_NAME => GO_BINARY_PATH
* using errors pkg
* fixing compile err
* removing redundant args
* removing requirement that caller calls Clear on fetch error
* fixing build
* fix
* adding masterminds semver
* returning better error
and checking version format
* removing unused error
* using proper semver function
* fixin compile err
* rm that shizz
29 lines
728 B
Go
29 lines
728 B
Go
package module
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gomods/athens/pkg/errors"
|
|
)
|
|
|
|
// ErrModuleExcluded is error returned when processing of error is skipped
|
|
// due to filtering rules
|
|
type ErrModuleExcluded struct {
|
|
module string
|
|
}
|
|
|
|
func (e *ErrModuleExcluded) Error() string {
|
|
return fmt.Sprintf("Module %s is excluded", e.module)
|
|
}
|
|
|
|
// NewErrModuleExcluded creates new ErrModuleExcluded
|
|
func NewErrModuleExcluded(module string) error {
|
|
return &ErrModuleExcluded{module: module}
|
|
}
|
|
|
|
// NewErrModuleAlreadyFetched returns an error indicating that a module has already been
|
|
// fetched
|
|
func NewErrModuleAlreadyFetched(op errors.Op, mod, ver string) error {
|
|
return errors.E(op, errors.M(mod), errors.V(ver), errors.KindAlreadyExists)
|
|
}
|