Documentation
¶
Index ¶
- Constants
- func CheckParams(op *catalog.Operation, params map[string]string) error
- func DraftRequest(ctx context.Context, base string, op *catalog.Operation, ...) (*http.Request, error)
- func IdempotencyFrom(ctx context.Context) string
- func InvokeResponse(ctx context.Context, cfg Config, op *catalog.Operation, ...) (*http.Response, error)
- func ReadBody(resp *http.Response) (string, error)
- func Sanitize(req *http.Request) (method, rawURL string, headers map[string]string, body string)
- func Unserializable(p catalog.Param) string
- func WithIdempotency(ctx context.Context, key string) context.Context
- func WithProjection(ctx context.Context, p Projection) context.Context
- type Client
- type Config
- type Projection
- type View
Constants ¶
View Source
const DefaultMaxResponseBytes int64 = 1 << 20
Variables ¶
This section is empty.
Functions ¶
func DraftRequest ¶
func DraftRequest(ctx context.Context, base string, op *catalog.Operation, params map[string]string) (*http.Request, error)
The upstream request without credentials. Strict checks stay on the real call.
func IdempotencyFrom ¶
func InvokeResponse ¶
func Unserializable ¶
Unserializable reports why a parameter cannot be placed on the request. An empty string means the call can send it.
func WithProjection ¶
func WithProjection(ctx context.Context, p Projection) context.Context
WithProjection carries invoke-request fields. They override the client list when set.
Types ¶
type Client ¶
type Client struct {
BaseURL string
HTTP *http.Client
RecordBody bool
Auth map[string]string
Creds *auth.Resolver
FollowPages int
FollowRedirects bool
MaxBody int64
Fields []string
Limit int
}
func (Client) InvokeHTTPResult ¶
func (Client) UpstreamBase ¶
type Projection ¶
type Projection struct {
Fields []string
Offset int
Limit int
// contains filtered or unexported fields
}
Projection names the response fields and the page to return. An empty Fields list leaves the body unchanged.
func ProjectionFrom ¶
func ProjectionFrom(ctx context.Context) (Projection, bool)
ProjectionFrom reports fields set on the invoke request.
Click to show internal directories.
Click to hide internal directories.