test

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout   = 5
	FieldURL         = "URL"
	FieldMethod      = "METHOD"
	FieldExpect      = "EXPECT"
	FieldContentType = "CTYPE"
	FieldAccept      = "ACCEPT"
	FieldPayload     = "PAYLOAD"
	FieldTimeoutSecs = "TIMEOUT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileDataCache added in v0.0.2

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

func NewFileDataCache added in v0.0.2

func NewFileDataCache() *FileDataCache

func (*FileDataCache) Get added in v0.0.2

func (c *FileDataCache) Get(filename string) ([]byte, error)

type HttpTest added in v0.0.2

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

HttpTest is a basic HTTP tester MUST set "URL" in params MAY set "METHOD" (default GET) MAY set PAYLOAD (default unset) to a string to use for request body, or @filename to read data from file MAY set CTYPE to content type (default unset) May set ACCEPT to accept type (default unset) May set TIMEOUT to timeout (in seconds, default 5) May set EXPECT to the expected status (test fails if expected status not received) Will trigger delegated tests, same context although of course you could provide modifications in the parameters for the next test

func (*HttpTest) Init added in v0.0.2

func (t *HttpTest) Init(params loadtest.InitContext)

func (*HttpTest) LoadBody added in v0.0.2

func (t *HttpTest) LoadBody(ctx loadtest.TestContext) (io.Reader, error)

func (*HttpTest) NewInstance added in v0.0.2

func (t *HttpTest) NewInstance() loadtest.Test

Retrieve a new instance of this test

func (*HttpTest) Run added in v0.0.2

func (t *HttpTest) Run(result *loadtest.Result, testContext loadtest.TestContext) *loadtest.TestContext

Run the test

type NopTest

type NopTest struct{}

NopTest is a simple "does nothing" test, mostly for testing.

func (*NopTest) NewInstance

func (t *NopTest) NewInstance() loadtest.Test

Retrieve a new instance of this test

func (*NopTest) Run

func (t *NopTest) Run(result *loadtest.Result, testContext loadtest.TestContext) *loadtest.TestContext

Run the test

Jump to

Keyboard shortcuts

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