Documentation ¶
Index ¶
- func CreateRandomLayers(n int) (map[digest.Digest]io.ReadSeeker, error)
- func CreateRandomTarFile() (rs io.ReadSeeker, dgst digest.Digest, err error)
- func MakeManifestList(blobstatter distribution.BlobStatter, manifestDigests []digest.Digest) (*manifestlist.DeserializedManifestList, error)
- func MakeSchema2Manifest(repository distribution.Repository, digests []digest.Digest) (distribution.Manifest, error)
- func NewHandler(requestResponseMap RequestResponseMap) http.Handler
- func PushBlob(ctx context.Context, repository distribution.Repository, ...) error
- func UploadBlobs(repository distribution.Repository, layers map[digest.Digest]io.ReadSeeker) error
- type Request
- type RequestResponseMap
- type RequestResponseMapping
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRandomLayers ¶
func CreateRandomLayers(n int) (map[digest.Digest]io.ReadSeeker, error)
CreateRandomLayers returns a map of n digests. We don't particularly care about the order of said digests (since they're all random anyway).
func CreateRandomTarFile ¶
func CreateRandomTarFile() (rs io.ReadSeeker, dgst digest.Digest, err error)
CreateRandomTarFile creates a random tarfile, returning it as an io.ReadSeeker along with its digest. An error is returned if there is a problem generating valid content.
func MakeManifestList ¶
func MakeManifestList(blobstatter distribution.BlobStatter, manifestDigests []digest.Digest) (*manifestlist.DeserializedManifestList, error)
MakeManifestList constructs a manifest list out of a list of manifest digests
func MakeSchema2Manifest ¶
func MakeSchema2Manifest(repository distribution.Repository, digests []digest.Digest) (distribution.Manifest, error)
MakeSchema2Manifest constructs a schema 2 manifest from a given list of digests and returns the digest of the manifest
func NewHandler ¶
func NewHandler(requestResponseMap RequestResponseMap) http.Handler
NewHandler returns a new test handler that responds to defined requests with specified responses Each time a Request is received, the next Response is returned in the mapping, until no Responses are defined, at which point a 404 is sent back
func PushBlob ¶
func PushBlob(ctx context.Context, repository distribution.Repository, blobReader io.ReadSeeker, dgst digest.Digest) error
PushBlob pushes a blob with the given digest to the given repository.
func UploadBlobs ¶
func UploadBlobs(repository distribution.Repository, layers map[digest.Digest]io.ReadSeeker) error
UploadBlobs lets you upload blobs to a repository
Types ¶
type Request ¶
type Request struct { // Method is the http method of the request, for example GET Method string // Route is the http route of this request Route string // QueryParams are the query parameters of this request QueryParams map[string][]string // Body is the byte contents of the http request Body []byte // Headers are the header for this request Headers http.Header }
Request is a simplified http.Request object
type RequestResponseMap ¶
type RequestResponseMap []RequestResponseMapping
RequestResponseMap is an ordered mapping from Requests to Responses
type RequestResponseMapping ¶
RequestResponseMapping defines a Response to be sent in response to a given Request