Documentation ¶
Index ¶
- func IsNotFound(err error) bool
- type HTTPClient
- type HTTPError
- type Interface
- type Request
- func (r *Request) AddQuery(key, value string) *Request
- func (r *Request) Body(bodyData interface{}) *Request
- func (r *Request) Context(ctx context.Context) *Request
- func (r *Request) Delete() *Request
- func (r *Request) Do() *Result
- func (r *Request) Error() error
- func (r *Request) Get() *Request
- func (r *Request) Name(resourceName string) *Request
- func (r *Request) Patch() *Request
- func (r *Request) Post() *Request
- func (r *Request) Prefix(segments ...string) *Request
- func (r *Request) Put() *Request
- func (r *Request) RequestPath(basePath string) *Request
- func (r *Request) Reset() *Request
- func (r *Request) Resource(name string) *Request
- func (r *Request) SetHeader(key, value string) *Request
- func (r *Request) Timeout(d time.Duration) *Request
- func (r *Request) URL() *url.URL
- func (r *Request) Verb(verb string) *Request
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
Types ¶
type HTTPClient ¶
HTTPClient is an interface for testing a request object.
type HTTPError ¶
type HTTPError struct {
// contains filtered or unexported fields
}
func NewHTTPError ¶
type Request ¶
type Request struct { Client HTTPClient // contains filtered or unexported fields }
func NewRequest ¶
func NewRequest(client HTTPClient, baseURL *url.URL) *Request
func (*Request) Context ¶
Context adds a context to the request. Contexts are only used for timeouts, deadlines, and cancellations.
func (*Request) Prefix ¶
Prefix adds segments to the relative beginning to the request path. These items will be placed before the Resource, or Name sections.
func (*Request) RequestPath ¶
RequestPath override the basePath of the request
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result contains the result of calling Request.Do().
func (Result) ContentType ¶
func (Result) StatusCode ¶
Click to show internal directories.
Click to hide internal directories.