Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { Kind string `json:"kind"` Name string `json:"name"` Spec RequestSpec `json:"spec"` }
Request represents a single resource which in itself can represent multiple types of requests for said resource, by creating RequestVariants.
func (*Request) Make ¶
Make makes a single HTTP request without a variant. Only the fields that come from the request will be used.
func (*Request) MakeWithVariant ¶
func (r *Request) MakeWithVariant( baseURL url.URL, v *Variant) (*http.Response, RequestStat, error)
Make makes an HTTP request requing the baseURL and the variant of the request resource.
type RequestSpec ¶
type RequestSpec struct { Uri string `json:"uri"` Method string `json:"method"` Data requestData `json:"data"` FormData url.Values `json:"formData"` Headers http.Header `json:"headers"` Variants Variants `json:"variants"` StashValues stash.StashValues `json:"stashValues"` }
RequestSpec represents the specification of the base request resource without any variants. A request can be made this way individually if there are no variants of it.
func (*RequestSpec) UnmarshalJSON ¶
func (rs *RequestSpec) UnmarshalJSON(j []byte) error
UnmarshalJSON will ensure that the request headers that are by default passed through as string values will become type http.Header upon unmarshling the JSON.
func (*RequestSpec) Update ¶
func (rs *RequestSpec) Update()
Update modifies the request spec to include any data that has recently been added to the stash. If new values exist, the values within the request spec will be added at this point.
type RequestStat ¶
type RequestStat struct {
Total int
}
type Variant ¶
type Variant struct { Name string `json:"name"` Path string `json:"path"` Method string `json:"method"` Data requestData `json:"data"` FormData url.Values `json:"formData"` Headers http.Header `json:"headers"` StashValues stash.StashValues `json:"stashValues"` }
RequestVariant represents a given variant for an HTTP request. This could be related to the same resource, but using a different request method or path for example.