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) DownloadSourcesWithContext(ctx context.Context, moduleName, version string) (io.ReadCloser, error)
- func (c *Client) GetInfo(moduleName, version string) (*VersionInfo, error)
- func (c *Client) GetInfoWithContext(ctx context.Context, moduleName, version string) (*VersionInfo, error)
- func (c *Client) GetLatest(moduleName string) (*VersionInfo, error)
- func (c *Client) GetLatestWithContext(ctx context.Context, moduleName string) (*VersionInfo, error)
- func (c *Client) GetModFile(moduleName, version string) (*modfile.File, error)
- func (c *Client) GetModFileWithContext(ctx context.Context, moduleName, version string) (*modfile.File, error)
- func (c *Client) GetSources(moduleName, version string) ([]byte, error)
- func (c *Client) GetSourcesWithContext(ctx context.Context, moduleName, version string) ([]byte, error)
- func (c *Client) GetVersions(moduleName string) ([]string, error)
- func (c *Client) GetVersionsWithContext(ctx context.Context, 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) DownloadSourcesWithContext ¶ added in v0.10.0
func (c *Client) DownloadSourcesWithContext(ctx context.Context, moduleName, version string) (io.ReadCloser, error)
DownloadSourcesWithContext 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) GetInfoWithContext ¶ added in v0.10.0
func (c *Client) GetInfoWithContext(ctx context.Context, moduleName, version string) (*VersionInfo, error)
GetInfoWithContext 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) GetLatestWithContext ¶ added in v0.10.0
GetLatestWithContext gets information about the latest module version.
<proxy URL>/<module name>/@latest
func (*Client) GetModFile ¶
GetModFile gets go.mod file.
func (*Client) GetModFileWithContext ¶ added in v0.10.0
func (c *Client) GetModFileWithContext(ctx context.Context, moduleName, version string) (*modfile.File, error)
GetModFileWithContext gets go.mod file.
func (*Client) GetSources ¶
GetSources gets the contents of the archive file.
func (*Client) GetSourcesWithContext ¶ added in v0.10.0
func (c *Client) GetSourcesWithContext(ctx context.Context, moduleName, version string) ([]byte, error)
GetSourcesWithContext gets the contents of the archive file.
func (*Client) GetVersions ¶
GetVersions gets all available module versions.
<proxy URL>/<module name>/@v/list