Documentation
¶
Index ¶
- func IsNotFound(e error) bool
- func NewRequest(ctx context.Context, method string, url string, body io.Reader, ...) (*http.Request, error)
- func NewUnexpectedStatusErr(resp *http.Response) error
- func ResponseToFile(resp *http.Response, file string) error
- type Client
- func (client Client) Do(req *http.Request) (*http.Response, error)
- func (client Client) Get(ctx context.Context, url string, opts ...RequestOption) (*http.Response, error)
- func (client Client) Head(ctx context.Context, url string, opts ...RequestOption) (*http.Response, error)
- func (client Client) Post(ctx context.Context, url string, body io.Reader, opts ...RequestOption) (*http.Response, error)
- func (client Client) Put(ctx context.Context, url string, body io.Reader, opts ...RequestOption) (*http.Response, error)
- type ErrUnexpectedStatus
- type Option
- type RequestOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
func NewRequest ¶
func NewUnexpectedStatusErr ¶
NewUnexpectedStatusErr creates an ErrUnexpectedStatus from HTTP response
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type ErrUnexpectedStatus ¶
type ErrUnexpectedStatus struct {
Status string `json:"status"`
StatusCode int `json:"statusCode"`
Body []byte `json:"body,omitempty"`
RequestURL string `json:"requestURL,omitempty"`
RequestMethod string `json:"requestMethod,omitempty"`
}
ErrUnexpectedStatus is returned if a registry API request returned with unexpected HTTP status
func (*ErrUnexpectedStatus) Error ¶
func (e *ErrUnexpectedStatus) Error() string
type RequestOption ¶
func WithAccept ¶
func WithAccept(allow ...string) RequestOption
func WithContentType ¶
func WithContentType(contentType string) RequestOption
Click to show internal directories.
Click to hide internal directories.