Documentation ¶
Index ¶
- func New(urlPath string, opts ...Opts) (*http.Request, error)
- type Opts
- func WithAuthToken(token string) Opts
- func WithDefaultAuthToken(token string) Opts
- func WithFormFile(filename string, data []byte) Opts
- func WithJSONBody(body string) Opts
- func WithJSONObjectBody(body interface{}) Opts
- func WithJSONStringTemplateBody(tmpl string, params interface{}) Opts
- func WithMethod(method string) Opts
- func WithURL(url url.URL) Opts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Opts ¶
type Opts func(*requestOpts)
Opts are functional options for the automate load balancer http request
func WithDefaultAuthToken ¶
WithDefaultAuthToken sets the auth token to use in the case that WithAuthToken never set an auth token. We use it to set the admin token
func WithFormFile ¶
WithFormFile does a multipart form request
func WithJSONBody ¶
WithJSONBody sets the body of a request. body should be a string containing json
func WithJSONObjectBody ¶
func WithJSONObjectBody(body interface{}) Opts
WithJSONObjectBody sets the body of the request to a JSON marshalled object
func WithJSONStringTemplateBody ¶
WithJSONStringTemplateBody renders the given json template with the given parameters as the request body
func WithMethod ¶
WithMethod sets the http method to use. By default, it is GET
Click to show internal directories.
Click to hide internal directories.