Documentation ¶
Overview ¶
Package download provides buffalo handlers that implement vgo's Download Protocol. This is so that both Zeus and Olympus can share the same download protocol implementation.
Index ¶
- Constants
- func LatestHandler(dp Protocol, lggr *log.Logger, eng *render.Engine) func(c buffalo.Context) error
- func ListHandler(dp Protocol, lggr *log.Logger, eng *render.Engine) func(c buffalo.Context) error
- func VersionInfoHandler(dp Protocol, lggr *log.Logger, eng *render.Engine) buffalo.Handler
- func VersionModuleHandler(dp Protocol, lggr *log.Logger, eng *render.Engine) buffalo.Handler
- func VersionZipHandler(dp Protocol, lggr *log.Logger, eng *render.Engine) buffalo.Handler
- type Protocol
Constants ¶
View Source
const PathLatest = "/{module:.+}/@latest"
PathLatest URL.
View Source
const PathList = "/{module:.+}/@v/list"
PathList URL.
View Source
const PathVersionInfo = "/{module:.+}/@v/{version}.info"
PathVersionInfo URL.
View Source
const PathVersionModule = "/{module:.+}/@v/{version}.mod"
PathVersionModule URL.
View Source
const PathVersionZip = "/{module:.+}/@v/{version}.zip"
PathVersionZip URL.
Variables ¶
This section is empty.
Functions ¶
func LatestHandler ¶
LatestHandler implements GET baseURL/module/@latest
func ListHandler ¶
ListHandler implements GET baseURL/module/@v/list
func VersionInfoHandler ¶
VersionInfoHandler implements GET baseURL/module/@v/version.info
func VersionModuleHandler ¶
VersionModuleHandler implements GET baseURL/module/@v/version.mod
Types ¶
type Protocol ¶
type Protocol interface { // List implements GET /{module}/@v/list List(ctx context.Context, mod string) ([]string, error) // Info implements GET /{module}/@v/{version}.info Info(ctx context.Context, mod, ver string) ([]byte, error) // Latest implements GET /{module}/@latest Latest(ctx context.Context, mod string) (*storage.RevInfo, error) // GoMod implements GET /{module}/@v/{version}.mod GoMod(ctx context.Context, mod, ver string) ([]byte, error) // Zip implements GET /{module}/@v/{version}.zip Zip(ctx context.Context, mod, ver string) (io.ReadCloser, error) // Version is a helper method to get Info, GoMod, and Zip together. Version(ctx context.Context, mod, ver string) (*storage.Version, error) }
Protocol is the download protocol which mirrors the http requests that cmd/go makes to the proxy.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.