Documentation ¶
Index ¶
- func ContentType(contentType string) func(*http.Request) error
- func DaemonHost() string
- func Delete(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
- func Do(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
- func DoOnHost(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
- func Get(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
- func JSON(req *http.Request) error
- func JSONBody(data interface{}) func(*http.Request) error
- func Method(method string) func(*http.Request) error
- func NewClient() (dclient.APIClient, error)
- func Post(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
- func RawContent(reader io.ReadCloser) func(*http.Request) error
- func RawString(content string) func(*http.Request) error
- func ReadBody(b io.ReadCloser) ([]byte, error)
- func SockConn(timeout time.Duration, daemon string) (net.Conn, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentType ¶
ContentType sets the specified Content-Type request header
func DaemonHost ¶
func DaemonHost() string
DaemonHost return the daemon host string for this test execution
func Delete ¶
func Delete(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
Delete creates and execute a DELETE request on the specified host and endpoint, with the specified request modifiers
func Do ¶
func Do(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
Do creates and execute a request on the specified endpoint, with the specified request modifiers
func DoOnHost ¶
func DoOnHost(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
DoOnHost creates and execute a request on the specified host and endpoint, with the specified request modifiers
func Get ¶
func Get(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
Get creates and execute a GET request on the specified host and endpoint, with the specified request modifiers
func JSONBody ¶
JSONBody creates a modifier that encodes the specified data to a JSON string and set it as request body. It also sets the Content-Type header of the request.
func Post ¶
func Post(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
Post creates and execute a POST request on the specified host and endpoint, with the specified request modifiers
func RawContent ¶
func RawContent(reader io.ReadCloser) func(*http.Request) error
RawContent sets the specified reader as body for the request
Types ¶
This section is empty.