Documentation
¶
Overview ¶
Package goproxy simple client for go modules proxy https://golang.org/cmd/go/#hdr-Module_proxy_protocol https://docs.gomods.io/intro/protocol/ https://go.googlesource.com/proposal/+/master/design/25530-sumdb.md
Index ¶
- type APIError
- type BasicAuthTransport
- type Client
- func (c *Client) DownloadSources(moduleName, version string) (io.ReadCloser, error)
- func (c *Client) GetInfo(moduleName, version string) (*VersionInfo, error)
- func (c *Client) GetLatest(moduleName string) (*VersionInfo, error)
- func (c *Client) GetModFile(moduleName, version string) (*modfile.File, error)
- func (c *Client) GetSources(moduleName, version string) ([]byte, error)
- func (c *Client) GetVersions(moduleName string) ([]string, error)
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAuthTransport ¶
type BasicAuthTransport struct { // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper // contains filtered or unexported fields }
BasicAuthTransport HTTP transport for API authentication.
func NewBasicAuthTransport ¶
func NewBasicAuthTransport(username, password string) (*BasicAuthTransport, error)
NewBasicAuthTransport Creates a new BasicAuthTransport.
func (*BasicAuthTransport) Client ¶
func (t *BasicAuthTransport) Client() *http.Client
Client Creates a new HTTP client.
type Client ¶
Client is the go modules proxy client.
func (*Client) DownloadSources ¶
func (c *Client) DownloadSources(moduleName, version string) (io.ReadCloser, error)
DownloadSources returns an io.ReadCloser that reads the contents of the archive file. It is the caller's responsibility to close the ReadCloser.
func (*Client) GetInfo ¶
func (c *Client) GetInfo(moduleName, version string) (*VersionInfo, error)
GetInfo gets information about a module version.
<proxy URL>/<module name>/@v/<version>.info
func (*Client) GetLatest ¶
func (c *Client) GetLatest(moduleName string) (*VersionInfo, error)
GetLatest gets information about the latest module version.
<proxy URL>/<module name>/@latest
func (*Client) GetModFile ¶
GetModFile gets go.mod file.
func (*Client) GetSources ¶
GetSources gets the contents of the archive file.