Documentation ¶
Index ¶
- Constants
- Variables
- type BodyProvider
- type Operation
- type Params
- type Request
- func (r *Request) AddQueryValue(key, value string) *Request
- func (r *Request) Invoke() (*http.Response, error)
- func (r *Request) JSONBody(p interface{}) *Request
- func (r *Request) JSONError(receiver error) *Request
- func (r *Request) JSONSuccess(receiver interface{}) *Request
- func (r *Request) MultipartFileBody(name string, contents io.Reader) *Request
- func (r *Request) PathParameter(name, value string) *Request
- func (r *Request) SetQueryValue(key, value string) *Request
- func (r *Request) URL() string
- type ResponseConsumer
- type SessionClient
Constants ¶
const RedactedFillin = "[REDACTED]"
RedactedFillin used as a replacement string in debug logs for sensitive data
Variables ¶
var ErrAuthenticationRequired = errors.New("Authentication token required")
ErrAuthenticationRequired is returned if a request is made before an authentication token has been provided to the client
Functions ¶
This section is empty.
Types ¶
type BodyProvider ¶
BodyProvider declares an interface that describes an HTTP body, for both request and response
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request defines the properties of an API request. It can then be invoked to call the underlying API specified by the supplied operation
func (*Request) AddQueryValue ¶
AddQueryValue ...
func (*Request) Invoke ¶
Invoke performs the request, and populates the response or error as appropriate
func (*Request) JSONBody ¶
JSONBody converts the supplied argument to JSON to use as the body of a request
func (*Request) JSONError ¶
JSONError configures the error to populate in the event of an unsuccessful (non-2xx) response
func (*Request) JSONSuccess ¶
JSONSuccess configures the receiver to use to process a JSON response for a successful (2xx) response
func (*Request) MultipartFileBody ¶
MultipartFileBody configures the POST payload to be sent in multi-part format. The content is read from the supplied Reader.
func (*Request) PathParameter ¶
PathParameter sets a path parameter to be resolved on invocation of a request
func (*Request) SetQueryValue ¶
SetQueryValue ...
type ResponseConsumer ¶
ResponseConsumer ...
type SessionClient ¶
type SessionClient interface { NewRequest(operation *Operation) *Request WithDebug(writer io.Writer) SessionClient WithAuthToken(authToken string) SessionClient WithPathParameter(name, value string) SessionClient WithQueryValue(name, value string) SessionClient }
SessionClient provides an interface for a REST API client go:generate counterfeiter -o fakes/client.go --fake-name SessionClient . SessionClient