Commit Graph

26 Commits

Author SHA1 Message Date
Marwan Sulaiman
889de448dc Fetcher: switch to mod download (#448) 2018-08-15 12:33:00 -04:00
Marwan Sulaiman
78687a7948 pkg/module: fix comment (#485) 2018-08-14 17:03:16 -07:00
Michal Pristas
327fecaedd rename Private to Direct (#481) 2018-08-14 11:13:36 +02:00
Michal Pristas
72a4af135a Removed ShouldProcess (#480)
* removed shouldProcess
* avoid Default as a return value for Rule
2018-08-14 10:28:39 +02:00
Federico Paolinelli
e6d4996bad Added support for private repos (#456)
* Added filter for private repos. Non private repos get redirected to
olympus

* Changed filter to allow private modules

* Changed config file name function

* Added filter tests

* The middleware returns 200 for privates, redirects public, 404 for
disabled repos

* Removed printf

* Removed forgotten printf

* Removed logger from the middleware func, not used anymore

* Removed unused (uncommented) function

* Replaced 404 with 403 in case of banned modules

* Fixed test path / cleaned olympus endpoint suffix

* Added error operation to GetVersion

* Moved filter test in custom file, reverted injection of the filter into
the app

* Removed white line

* Clarified comment for ignoring getversion error

* Added todo comment to fill the cache and serve the request with the
cache

* Added error handling to filter

* Removed commented early version of the test
2018-08-13 16:35:17 -07:00
Marwan Sulaiman
5f02ada292 pkg/module: add errors op (#464) 2018-08-13 11:54:48 -04:00
Marwan Sulaiman
ca7fdeae6b pkg/module: remove unused module.Fetch (#459) 2018-08-13 08:43:15 -04:00
Marwan Sulaiman
44625459fc Download: move cache location (#404)
* Download: move cache location

* beta3

* trying differnet repo

* avoid go breaking stuff
2018-08-04 11:29:30 -07:00
Dinesh Kumar
85213f20b3 Goget Fetcher should error out if gobinpath is not valid (#377)
* Goget fetcher should error out if gobinpath is not valid

* Propogating the error from goget initialisation to main, to stop application

* wrapping errors with op, using exec.command(gobin).Run to verify gobin, clean up

* Inlining afero fs to goget call, and new go getfetcher

* Revert "Inlining afero fs to goget call, and new go getfetcher"

This reverts commit ae31fe6a2b.

* Fixing example test
2018-08-02 10:00:37 -04:00
Marwan Sulaiman
441e21d281 Proxy: fill cache on Protocol.Version (#374) 2018-07-31 23:11:49 -07:00
Rohan Chakravarthy
bbe1ce1873 zip.Close() also clears the GOPATH of the underlying diskRef (#367)
* zip.Close() also clears underlying diskRef

* remove unnecessary constructor

* use GoBinPath() in example
2018-07-31 12:38:45 -04:00
Marwan Sulaiman
43cb601718 athens: encode/decode modules per cmd/go rules (#366) 2018-07-31 03:29:23 -04:00
Rohan Chakravarthy
c7d0c0a8e6 Ensure diskRef cleans up everything in it's own GOPATH (#354)
* Ensure diskRef cleans up everything in it's own GOPATH

* cleanup diskref opens. Fix err return in go_get_fetcher

* Remove Noop ref from go_get_fetcher.Fetch()

* handle temp dir cleanup and return nil diskref
2018-07-30 19:14:06 -04:00
Marwan Sulaiman
add15e68cd download: clean up Kahona (#345) 2018-07-27 15:18:14 -07:00
Carolyn Van Slyck
fd7c1326d3 Backfill the cache on a miss (#342)
* add middlewares to fill the cache and to populate contexts with module and versions

* Carolyn tries to fix Aaron's code

* #DOINSTUFF

* updated env var

* fix all the things

* magic patch for olympus

* Add latest handler

* Remove deprecated return param

* go fmt all the things
2018-07-27 14:37:23 -07:00
Marwan Sulaiman
7b590b1885 download: add list from go cli (#336)
* download: add list from go cli

* download: include goget tests + hacky hack

* download: move dummyMod to pkg/module

* Olympus: pass dp and lggr to /list

* download: add Version to interface

* download: document Protocol
2018-07-27 11:56:32 -07:00
Aaron Schlesinger
ab9a4c0f41 Moving the fetch logic into 'pkg/module' (#291)
* 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
2018-07-26 13:08:07 -07:00
Komu Wairagu
d74e0640fe remove dead code (#267)
* remove spf13/cobra and inconshreveable/mousetrap

* remove user package

* remove user package

* remove unused types, vars etc
found by using github.com/dominikh/go-tools/tree/master/cmd/unused.running  unused $(go list github.com/gomods/athens/... | grep -v /vendor/)

* rm uneeded file
2018-07-19 08:34:16 -07:00
marpio
9913736bc7 Download module version from CDN (#283)
* add download function which downloads a ver from cdn

* use cdn download func

* save after rename

* review feedback

* just to trigger a build

* pass timeout and move to pkg/module

* use multierror

* rm empty line
2018-07-18 15:31:30 -07:00
Michal Pristas
514ac49659 Support for exclude include (#212)
* almost there

* loading file

* fixed after real test

* fixed includes"

* configurable filter name

* custom error
2018-07-09 09:58:51 -07:00
Marwan Sulaiman
32d5b3535c Fix upload nil pointer dereference (#217) 2018-07-08 15:50:31 -07:00
marpio
58d42a1b57 Stream zips (#200)
* storage.saver interface - use io.reader instead of []byte

* stream zip - backendconnector

* stream zip - azurecdn

* stream zip - fs

* storage - switch to io.Reader

* update callers of Save

* rm empty line

* makezip stream

* refactor mergedb

* add multierror dep

* mergedb multierror

* scope err

* update storages

* return pipereader

* fix test

* use multierror for all strorage drivers

* review feedback

* azure cdn storage - use UploadStreamToBlockBlob

* use numUpload

* use timeout ctx
2018-07-07 08:46:43 -07:00
marpio
8ceda38ad7 replace fs operations with afero (#123)
* replace fs operations with afero

* fix goget test

* fix test

* fix test again...

* remove empty lines

* fix merge

setupTmp - return 3, not 2 values

* just to start new travis build

got The command "go get github.com/golang/lint/golint" failed and exited with 1 during . I hope it was a temp problem.
2018-05-13 12:40:09 -07:00
marpio
769f833999 add gofmt, golint and go vet to ci (#85)
* add gofmt, golint and go vet to ci

* result of gofmt -w .
2018-03-22 14:46:59 -07:00
Aaron Schlesinger
a6721f7505 Remove the base URL (#60)
* Removing concept of a baseURL

Just using a single ‘module’ and ‘version’ concept is enough

* go build => buffalo build
2018-03-21 16:03:44 -07:00
Michal Pristas
1df7400819 not tested version (#54) 2018-03-15 20:01:54 +01:00