Documentation ¶
Overview ¶
Package moduleproxy provides a Go module proxy client and server.
Index ¶
- type Client
- func (c Client) GoMod(ctx context.Context, mod module.Version) ([]byte, error)
- func (c Client) Info(ctx context.Context, mod module.Version) (Info, error)
- func (c Client) Latest(ctx context.Context, modulePath string) (Info, error)
- func (c Client) List(ctx context.Context, modulePath string) ([]string, error)
- func (c Client) Zip(ctx context.Context, mod module.Version) ([]byte, error)
- type Info
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { URL url.URL // DisableModuleFetch controls whether to set the // non-standard Disable-Module-Fetch: true header. DisableModuleFetch bool }
Client is a low-level module proxy client that targets the proxy at URL.
func (Client) GoMod ¶
GoMod fetches the go.mod file for the given module version. It returns os.ErrNotExist if it doesn't exist.
func (Client) Info ¶
Info fetches the .info file for the given module version. It returns os.ErrNotExist if it doesn't exist.
func (Client) Latest ¶
Latest fetches the optional /@latest endpoint for the given module. It returns os.ErrNotExist if the module doesn't exist, or if the optional /@latest endpoint isn't implemented by the server.
Click to show internal directories.
Click to hide internal directories.