Documentation ¶
Index ¶
- func ContentType(contentType string) func(*Options)
- func DaemonHost() string
- func DaemonTime(ctx context.Context, t testing.TB, client client.APIClient, ...) time.Time
- func DaemonUnixTime(ctx context.Context, t testing.TB, client client.APIClient, ...) string
- func Delete(ctx context.Context, endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
- func Do(ctx context.Context, endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
- func Get(ctx context.Context, endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
- func Head(ctx context.Context, 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 testing.TB, ops ...client.Opt) client.APIClient
- func Post(ctx context.Context, 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 testing.TB, 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 testing.TB, 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 ¶
func Delete(ctx context.Context, endpoint string, modifiers ...func(*Options)) (*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(ctx context.Context, endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
Do creates and execute a request on the specified endpoint, with the specified request modifiers
func Get ¶
func Get(ctx context.Context, endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
Get creates and execute a GET request on the specified host and endpoint, with the specified request modifiers
func Head ¶
func Head(ctx context.Context, endpoint string, modifiers ...func(*Options)) (*http.Response, io.ReadCloser, error)
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 ¶
func Post(ctx context.Context, endpoint string, modifiers ...func(*Options)) (*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(*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