Documentation ¶
Index ¶
- func ContentType(contentType string) func(*Options)
- func DaemonHost() string
- func DaemonTime(ctx context.Context, t assert.TestingT, client client.APIClient, ...) time.Time
- func DaemonUnixTime(ctx context.Context, t assert.TestingT, client client.APIClient, ...) string
- func Delete(endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
- func Do(endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
- func Get(endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
- func Head(endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
- func Host(host string) func(*Options)
- func JSON(o *Options)
- func JSONBody(data interface{}) func(*Options)
- func Method(method string) func(*Options)
- func NewAPIClient(t assert.TestingT, ops ...client.Opt) client.APIClient
- func Post(endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
- func RawContent(reader io.ReadCloser) func(*Options)
- func RawString(content string) func(*Options)
- func ReadBody(b io.ReadCloser) ([]byte, error)
- func SockConn(timeout time.Duration, daemon string) (net.Conn, error)
- func With(f func(*http.Request) error) func(*Options)
- type Options
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 DaemonTime ¶
func DaemonTime(ctx context.Context, t assert.TestingT, client client.APIClient, testEnv *environment.Execution) time.Time
DaemonTime provides the current time on the daemon host
func DaemonUnixTime ¶
func DaemonUnixTime(ctx context.Context, t assert.TestingT, client client.APIClient, testEnv *environment.Execution) string
DaemonUnixTime returns the current time on the daemon host with nanoseconds precision. It return the time formatted how the client sends timestamps to the server.
func Delete ¶
Delete creates and execute a DELETE request on the specified host and endpoint, with the specified request modifiers
func Do ¶
Do creates and execute a request on the specified endpoint, with the specified request modifiers
func Get ¶
Get creates and execute a GET request on the specified host and endpoint, with the specified request modifiers
func Head ¶
Head creates and execute a HEAD request on the specified host and endpoint, with the specified request modifiers
func JSONBody ¶
func JSONBody(data interface{}) func(*Options)
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 NewAPIClient ¶
NewAPIClient returns a docker API client configured from environment variables
func Post ¶
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(*Options)
RawContent sets the specified reader as body for the request
func ReadBody ¶
func ReadBody(b io.ReadCloser) ([]byte, error)
ReadBody read the specified ReadCloser content and returns it