Documentation
¶
Overview ¶
Package cargo implements the Cargo sparse-index mirror backend.
Index ¶
- Constants
- type Detail
- 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"`
VersionsCount int `json:"versions_count,omitempty"`
}
Detail is cargo's PackageResult.Detail payload.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements core.Prober for Cargo sparse HTTP indexes.
func (*Service) Package ¶
func (s *Service) Package(ctx context.Context, mirror string, q core.PackageQuery) (core.PackageResult, error)
Package looks up a crate in the sparse index.
func (*Service) Resolve ¶
func (s *Service) Resolve(ctx context.Context, mirror string, q core.PackageQuery) (core.DownloadResult, error)
Resolve returns the direct .crate download URL, honoring the mirror's config.json "dl" template when present.