Documentation
¶
Overview ¶
Package acquire coordinates package artifact resolution, downloading, integrity verification, and storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound reports that a store has no artifact matching a request. ErrNotFound = errors.New("artifact not found") // ErrOffline reports that acquisition would require an upstream request. ErrOffline = errors.New("artifact unavailable offline") // ErrTooLarge reports that an artifact exceeds the configured byte limit. ErrTooLarge = errors.New("artifact exceeds size limit") )
Functions ¶
This section is empty.
Types ¶
type Download ¶
type Download struct {
Body io.ReadCloser
Size int64
MediaType string
}
Download is a streaming upstream response. Size is -1 when unavailable.
type Entry ¶
type Entry struct {
Artifact artifacts.Artifact
Body io.ReadCloser
}
Entry is a completed artifact opened from a Store.
type Request ¶
Request identifies one package artifact. Filename and Integrity may narrow a version that has several published files.
type Result ¶
type Result struct {
Artifact artifacts.Artifact
Body io.ReadCloser
Cached bool
}
Result is an acquired artifact and a reader positioned at its first byte.
type Service ¶
Service acquires package artifacts through supplied resolver, fetcher, and store implementations.
type Source ¶
Source describes the upstream file selected for a request. Integrity is used when the request did not supply lockfile integrity metadata.
type Stage ¶
type Stage interface {
io.Writer
Commit(context.Context, artifacts.Artifact) (io.ReadCloser, error)
Discard(context.Context) error
}
Stage receives unverified bytes. Commit publishes them and returns a fresh reader. Discard removes an unpublished stage.
type Store ¶
type Store interface {
Open(context.Context, Request) (*Entry, error)
Stage(context.Context, Request, Source) (Stage, error)
}
Store finds completed artifacts and creates private staging writes.
Open must return ErrNotFound when no completed artifact matches every populated Request field. A Stage must remain unavailable through Open until Commit succeeds.