Documentation
¶
Index ¶
- type Registry
- func (r *Registry) Close()
- func (r *Registry) CopyManifest(repo, srcRef, dstRef string)
- func (r *Registry) CountRequests(method, pathPart string) int
- func (r *Registry) HasBlob(repo string, d digest.Digest) bool
- func (r *Registry) HasManifest(repo, ref string) bool
- func (r *Registry) Host() string
- func (r *Registry) PutBlob(repo string, content []byte) digest.Digest
- func (r *Registry) PutManifest(repo, ref, mediaType string, data []byte) digest.Digest
- func (r *Registry) RangeRequests(d digest.Digest) []string
- func (r *Registry) Requests() []ReqRecord
- func (r *Registry) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Registry) SetCorruptBlob(d digest.Digest)
- func (r *Registry) SetFailBlobReads(d digest.Digest, n int, afterBytes int64)
- func (r *Registry) SetIgnoreRange(v bool)
- func (r *Registry) SetMissingManifestStatus(code int)
- type ReqRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) Close ¶ added in v0.3.0
func (r *Registry) Close()
Close stops serving before the test ends, so a test can assert that what follows needs no registry rather than merely assuming it. Cleanup closes the server too; both calls are safe.
func (*Registry) CopyManifest ¶
CopyManifest republished the manifest stored under srcRef in repo under dstRef, to simulate signature-substitution attacks in tests.
func (*Registry) CountRequests ¶
countRequests returns how many logged requests match method and a path substring.
func (*Registry) HasManifest ¶
HasManifest reports whether repo has a manifest under ref.
func (*Registry) PutManifest ¶
func (*Registry) RangeRequests ¶
rangeRequests returns the Range header values seen on GETs of the blob.
func (*Registry) SetCorruptBlob ¶
SetCorruptBlob serves flipped bytes for this digest.
func (*Registry) SetFailBlobReads ¶
SetFailBlobReads makes the next n GETs of blob d serve only afterBytes bytes and then drop the connection.
func (*Registry) SetIgnoreRange ¶
SetIgnoreRange makes blob GETs disregard Range headers.
func (*Registry) SetMissingManifestStatus ¶ added in v0.3.0
SetMissingManifestStatus changes what an unknown manifest answers. Real registries are not consistent about this, and code that treats only 404 as "absent" breaks against the ones that refuse to confirm existence.