Documentation
¶
Overview ¶
Package gomod implements the Go module proxy (GOPROXY protocol) backend.
Index ¶
- Constants
- type Detail
- type ModInfo
- type ResolveOptions
- type Service
- func (s *Service) Package(ctx context.Context, mirror string, q core.PackageQuery) (core.PackageResult, error)
- func (s *Service) Resolve(ctx context.Context, mirror string, q core.PackageQuery) (core.DownloadResult, error)
- func (s *Service) Speed(ctx context.Context, mirror string, o core.SpeedOptions) (core.SpeedResult, error)
- func (s *Service) Status(ctx context.Context, mirror string) (core.StatusResult, error)
Constants ¶
const DefaultSpeedDuration = 10 * time.Second
DefaultSpeedDuration bounds a speed-test download.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detail ¶
type Detail struct {
Versions []string `json:"versions,omitempty"`
Info *ModInfo `json:"info,omitempty"`
}
Detail is gomod's PackageResult.Detail payload.
type ResolveOptions ¶
type ResolveOptions struct {
// File is "zip" (default) or "mod".
File string
}
ResolveOptions selects which GOPROXY artifact Resolve returns.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements core.Prober for GOPROXY-style mirrors.
func (*Service) Package ¶
func (s *Service) Package(ctx context.Context, mirror string, q core.PackageQuery) (core.PackageResult, error)
Package lists versions and resolves the latest via @v/list + @v/latest.info.
func (*Service) Resolve ¶
func (s *Service) Resolve(ctx context.Context, mirror string, q core.PackageQuery) (core.DownloadResult, error)
Resolve returns the direct .zip (or .mod with Options) URL.