url

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 21 Imported by: 133

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CURL

type CURL struct {
	Code int `json:"code"`
}

type Response

type Response struct {
	Test       int    `json:"test"`
	ReturnCode int    `json:"rc"`
	Error      string `json:"error"`

	CURL    CURL   `json:"curl"`
	Body    []byte `json:"body"`
	Headers string `json:"headers"`

	Response *http.Response
}

type Test

type Test struct {
	Name       string
	Req        *http.Request
	ProxyHost  string
	SkipVerify bool
	// we capture this here vs. the httpRequest
	// to facilitate passing to curl
	PostBodyFile string
	PodName      string
	Oc           *exutil.CLI

	Wants []func(*http.Response) error
}

func Expect

func Expect(method, url string) *Test

func (*Test) HasStatusCode

func (ut *Test) HasStatusCode(codes ...int) *Test

func (*Test) RedirectsTo

func (ut *Test) RedirectsTo(url string, codes ...int) *Test

func (*Test) SkipTLSVerification

func (ut *Test) SkipTLSVerification() *Test

func (*Test) Test

func (ut *Test) Test(i int, res *Response) error

func (*Test) Through

func (ut *Test) Through(host string) *Test

Through configures the test to send requests through the given host. The host may be specified as a host name, IPv4 address, or bracketed IPv6 address. Use this method when the request specifies some host A that is different from the actual host B to which the connection must be made. For example, host A may belong to a route, and host B may be an HAProxy pod that serves the route. This method is useful when DNS is not configured to resolve host A's host name.

func (*Test) ToShell

func (ut *Test) ToShell(i int) string

func (*Test) WithBodyToUpload

func (ut *Test) WithBodyToUpload(filename, podname string, oc *exutil.CLI) *Test

func (*Test) WithHeader

func (ut *Test) WithHeader(hdr, value string) *Test

func (*Test) WithToken

func (ut *Test) WithToken(token string) *Test

type Tester

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

func NewTester

func NewTester(client kclientset.Interface, ns string) *Tester

func (*Tester) Close

func (ut *Tester) Close()

func (*Tester) Podname

func (ut *Tester) Podname() string

func (*Tester) Response

func (ut *Tester) Response(test *Test) *Response

func (*Tester) Responses

func (ut *Tester) Responses(tests ...*Test) []*Response

func (*Tester) WithErrorPassthrough

func (ut *Tester) WithErrorPassthrough(pt bool) *Tester

func (*Tester) Within

func (ut *Tester) Within(t time.Duration, tests ...*Test)

Jump to

Keyboard shortcuts

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