Documentation ¶
Index ¶
Constants ¶
View Source
const ( HeaderChallenge = "Www-Authenticate" HeaderAuthorization = "Authorization" HeaderContentType = "Content-Type" HeaderAccept = "Accept" HeaderLink = "Link" )
HTTP related constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { Method string `json:"method"` URL *url.URL `json:"url"` HeaderAuthorization string `json:"authorization"` StartedAt time.Time `json:"startedAt"` }
Request represents a request made to the registry.
type Response ¶
type Response struct { Code int `json:"code,omitempty"` HeaderChallenge string `json:"Www-Authenticate,omitempty"` HeaderLocation *url.URL `json:"redirectLocation,omitempty"` HeaderLink string `json:"link,omitempty"` Size int64 `json:"size,omitempty"` SHA256Sum digest.Digest `json:"sha256,omitempty"` Body json.RawMessage `json:"body,omitempty"` }
Response respresents a response received from the registry.
type RoundTripInfo ¶
type RoundTripInfo struct { Request `json:"request"` Response `json:"response"` Elapsed string `json:"elapsed"` }
RoundTripInfo represents information about a network round-trip.
type RoundTripper ¶
type RoundTripper interface { // RoundTrip makes an HTTP request and returns the response with some stats. RoundTrip(req *http.Request) (RoundTripInfo, error) }
RoundTripper provides a means to do an HTTP/HTTPs round trip.
type RoundTripperWithContext ¶
type RoundTripperWithContext struct { Base http.RoundTripper Logger zerolog.Logger }
RoundTripperWithContext provides an implementation for RoundTripper.
func (RoundTripperWithContext) RoundTrip ¶
func (r RoundTripperWithContext) RoundTrip(req *http.Request) (RoundTripInfo, error)
RoundTrip does an HTTP/HTTPs roundtrip and returns the response with some contextual info.
Click to show internal directories.
Click to hide internal directories.