testclient

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestID     string = "test_id"
	Scenario   string = "scenario"
	StatusCode string = "status_code"
	Health     string = "/health"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, projectID string, pubsubInfo *setuptf.PubsubInfo) (*Client, error)

func (*Client) Request

func (c *Client) Request(
	ctx context.Context,
	request Request,
) (*Response, error)

func (*Client) WaitForHealth

func (c *Client) WaitForHealth(ctx context.Context, logger *log.Logger) error

Call in TestMain() to block until the test server is ready for requests. Uses a *log.Logger because this runs before testing.T is available

type Request

type Request struct {
	// name of the scenario to run
	Scenario string
	TestID   string
	Headers  map[string]string
}

type Response

type Response struct {
	StatusCode code.Code
	Headers    map[string]string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL