Documentation ¶
Overview ¶
Package proxy contains a Go proxy that serves modules from S3.
Index ¶
- type Copier
- type Downloader
- type ProxyHandler
- func (h *ProxyHandler) GoMod(ctx context.Context, m module.Version) (io.ReadCloser, error)
- func (h *ProxyHandler) Info(ctx context.Context, m module.Version) (io.ReadCloser, error)
- func (h *ProxyHandler) List(ctx context.Context, modulePath string) (io.ReadCloser, error)
- func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *ProxyHandler) Zip(ctx context.Context, m module.Version) (io.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Copier ¶
type Copier struct {
// contains filtered or unexported fields
}
Copier copies a module to S3. Use NewCopier to initiate one.
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
Downloader reads a Go module from an S3 bucket. Use NewDownloader to initialize one.
func NewDownloader ¶
func NewDownloader(s *session.Session, bucket string) *Downloader
func (*Downloader) Download ¶
func (d *Downloader) Download(modulePath string, name string) (io.ReadCloser, error)
Download downloads a module from an S3 bucket. modulePath is the import path of the module, e.g. golang.org/x/text. name is the asset's name such as v0.3.0.info, v0.3.0.mod, v0.3.0.ziphash, or v0.3.0.zip.
type ProxyHandler ¶
type ProxyHandler struct {
Downloader *Downloader
}
func (*ProxyHandler) GoMod ¶
func (h *ProxyHandler) GoMod(ctx context.Context, m module.Version) (io.ReadCloser, error)
GoMod returns the module .mod for the specified version.
func (*ProxyHandler) Info ¶
func (h *ProxyHandler) Info(ctx context.Context, m module.Version) (io.ReadCloser, error)
Info returns the module .info for the specified version.
func (*ProxyHandler) List ¶
func (h *ProxyHandler) List(ctx context.Context, modulePath string) (io.ReadCloser, error)
List returns the module listing. Module path is in the format of golang.org/x/text.
func (*ProxyHandler) ServeHTTP ¶
func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implement a Go proxy server handler.
func (*ProxyHandler) Zip ¶
func (h *ProxyHandler) Zip(ctx context.Context, m module.Version) (io.ReadCloser, error)
Zip returns the module .zip for the specified version.