Documentation ¶
Index ¶
- Constants
- func WithAuthScope(authScope string) clientOption
- func WithDebug(debug bool) clientOption
- func WithDefaultName(namespace string) clientOption
- func WithDigest(digest string) requestOption
- func WithInsecureSkipTLSVerify(skip bool) clientOption
- func WithName(name string) requestOption
- func WithReference(ref string) requestOption
- func WithRetryCallback(cb RetryCallbackFunc) requestOption
- func WithSessionID(id string) requestOption
- func WithUserAgent(userAgent string) clientOption
- func WithUsernamePassword(username string, password string) clientOption
- type Client
- type ErrorInfo
- type ErrorResponse
- type Request
- type Response
- type RetryCallbackFunc
Constants ¶
const ( // GET represents the HTTP GET method. GET = resty.MethodGet // PUT represents the HTTP PUT method. PUT = resty.MethodPut // PATCH represents the HTTP PATCH method. PATCH = resty.MethodPatch // DELETE represents the HTTP DELETE method. DELETE = resty.MethodDelete // POST represents the HTTP POST method. POST = resty.MethodPost // HEAD represents the HTTP HEAD method. HEAD = resty.MethodHead // OPTIONS represents the HTTP OPTIONS method. OPTIONS = resty.MethodOptions )
const (
DefaultUserAgent = "reggie/0.3.0 (https://github.com/bloodorangeio/reggie)"
)
Variables ¶
This section is empty.
Functions ¶
func WithAuthScope ¶ added in v0.3.3
func WithAuthScope(authScope string) clientOption
WithAuthScope overrides the scope provided by the authorization server.
func WithDebug ¶ added in v0.2.0
func WithDebug(debug bool) clientOption
WithDebug enables or disables debug mode.
func WithDefaultName ¶ added in v0.2.0
func WithDefaultName(namespace string) clientOption
WithDefaultName sets the default registry namespace configuration setting.
func WithDigest ¶ added in v0.2.0
func WithDigest(digest string) requestOption
WithDigest sets the digest per a single request.
func WithInsecureSkipTLSVerify ¶ added in v0.6.0
func WithInsecureSkipTLSVerify(skip bool) clientOption
WithInsecureSkipTLSVerify configures the insecure option to skip TLS verification.
func WithName ¶ added in v0.2.0
func WithName(name string) requestOption
WithName sets the namespace per a single request.
func WithReference ¶ added in v0.2.0
func WithReference(ref string) requestOption
WithReference sets the reference per a single request.
func WithRetryCallback ¶ added in v0.5.0
func WithRetryCallback(cb RetryCallbackFunc) requestOption
WithRetryCallback specifies a callback that will be invoked before a request is retried. This is useful for, e.g., ensuring an io.Reader used for the body will produce the right content on retry.
func WithSessionID ¶ added in v0.2.0
func WithSessionID(id string) requestOption
WithSessionID sets the session ID per a single request.
func WithUserAgent ¶ added in v0.3.0
func WithUserAgent(userAgent string) clientOption
WithUserAgent overrides the client user agent
func WithUsernamePassword ¶ added in v0.2.0
WithUsernamePassword sets registry username and password configuration settings.
Types ¶
type Client ¶
type Client struct { *resty.Client Config *clientConfig }
Client is an HTTP(s) client to make requests against an OCI registry.
func (*Client) NewRequest ¶
NewRequest builds a new Request from provided options.
func (*Client) SetDefaultName ¶ added in v0.2.0
SetDefaultName sets the default registry namespace to use for building a Request.
type ErrorInfo ¶ added in v0.3.0
type ErrorInfo struct { Code string `json:"code"` Message string `json:"message"` Detail interface{} `json:"detail"` }
ErrorInfo describes a server error returned from a registry.
type ErrorResponse ¶ added in v0.3.2
type ErrorResponse struct {
Errors []ErrorInfo `json:"errors"`
}
type Request ¶
type Request struct { *resty.Request // contains filtered or unexported fields }
Request is an HTTP request to be sent to an OCI registry.
func (*Request) SetBody ¶ added in v0.2.0
SetBody wraps the resty SetBody and returns the request, allowing method chaining
func (*Request) SetHeader ¶ added in v0.2.1
SetHeader wraps the resty SetHeader and returns the request, allowing method chaining
func (*Request) SetQueryParam ¶ added in v0.2.1
SetQueryParam wraps the resty SetQueryParam and returns the request, allowing method chaining
type Response ¶
type Response struct {
*resty.Response
}
Response is an HTTP response returned from an OCI registry.
func (*Response) Errors ¶ added in v0.2.1
Errors attempts to parse a response as OCI-compliant errors array
func (*Response) GetAbsoluteLocation ¶ added in v0.2.0
GetAbsoluteLocation returns the full URL, including protocol and host, of the location contained in the `Location` header of the response.
func (*Response) GetRelativeLocation ¶ added in v0.2.0
GetRelativeLocation returns the path component of the URL contained in the `Location` header of the response.
func (*Response) IsUnauthorized ¶
IsUnauthorized returns whether or not the response is a 401
type RetryCallbackFunc ¶ added in v0.5.0
RetryCallbackFunc is a function that can mutate a request prior to it being retried.