http

package
v1.15.12 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cookie(name, value string) *http.Cookie

func Cookies

func Cookies(data map[string]string) []*http.Cookie

func NewAssertableJSON

func NewAssertableJSON(t *testing.T, json foundation.Json, jsonStr string) (contractshttp.AssertableJSON, error)

func NewTestRequest

func NewTestRequest(t *testing.T, json foundation.Json, route route.Route, session session.Manager) contractshttp.Request

func NewTestResponse

func NewTestResponse(t *testing.T, response *http.Response, json foundation.Json, session contractssession.Manager) contractshttp.Response

Types

type AssertableJson

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

func (*AssertableJson) Count

func (r *AssertableJson) Count(key string, length int) contractshttp.AssertableJSON

func (*AssertableJson) Each

func (*AssertableJson) First

func (*AssertableJson) Has

func (*AssertableJson) HasAll

func (*AssertableJson) HasAny

func (*AssertableJson) HasWithScope

func (r *AssertableJson) HasWithScope(key string, length int, callback func(contractshttp.AssertableJSON)) contractshttp.AssertableJSON

func (*AssertableJson) Json

func (r *AssertableJson) Json() map[string]any

func (*AssertableJson) Missing

func (*AssertableJson) MissingAll

func (r *AssertableJson) MissingAll(keys []string) contractshttp.AssertableJSON

func (*AssertableJson) Where

func (r *AssertableJson) Where(key string, value any) contractshttp.AssertableJSON

func (*AssertableJson) WhereNot

func (r *AssertableJson) WhereNot(key string, value any) contractshttp.AssertableJSON

type TestRequest

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

func (*TestRequest) Bind

func (r *TestRequest) Bind(value any) contractshttp.Request

func (*TestRequest) Delete

func (r *TestRequest) Delete(uri string, body io.Reader) (contractshttp.Response, error)

func (*TestRequest) FlushHeaders

func (r *TestRequest) FlushHeaders() contractshttp.Request

func (*TestRequest) Get

func (*TestRequest) Head

func (r *TestRequest) Head(uri string) (contractshttp.Response, error)

func (*TestRequest) Options

func (r *TestRequest) Options(uri string) (contractshttp.Response, error)

func (*TestRequest) Patch

func (r *TestRequest) Patch(uri string, body io.Reader) (contractshttp.Response, error)

func (*TestRequest) Post

func (r *TestRequest) Post(uri string, body io.Reader) (contractshttp.Response, error)

func (*TestRequest) Put

func (r *TestRequest) Put(uri string, body io.Reader) (contractshttp.Response, error)

func (*TestRequest) WithBasicAuth

func (r *TestRequest) WithBasicAuth(username, password string) contractshttp.Request

func (*TestRequest) WithContext

func (r *TestRequest) WithContext(ctx context.Context) contractshttp.Request

func (*TestRequest) WithCookie

func (r *TestRequest) WithCookie(cookie *http.Cookie) contractshttp.Request

func (*TestRequest) WithCookies

func (r *TestRequest) WithCookies(cookies []*http.Cookie) contractshttp.Request

func (*TestRequest) WithHeader

func (r *TestRequest) WithHeader(key, value string) contractshttp.Request

func (*TestRequest) WithHeaders

func (r *TestRequest) WithHeaders(headers map[string]string) contractshttp.Request

func (*TestRequest) WithSession

func (r *TestRequest) WithSession(attributes map[string]any) contractshttp.Request

func (*TestRequest) WithToken

func (r *TestRequest) WithToken(token string, ttype ...string) contractshttp.Request

func (*TestRequest) WithoutHeader

func (r *TestRequest) WithoutHeader(key string) contractshttp.Request

func (*TestRequest) WithoutToken

func (r *TestRequest) WithoutToken() contractshttp.Request

type TestResponseImpl

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

func (*TestResponseImpl) AssertAccepted

func (r *TestResponseImpl) AssertAccepted() contractshttp.Response

func (*TestResponseImpl) AssertBadRequest

func (r *TestResponseImpl) AssertBadRequest() contractshttp.Response

func (*TestResponseImpl) AssertConflict

func (r *TestResponseImpl) AssertConflict() contractshttp.Response

func (*TestResponseImpl) AssertCookie

func (r *TestResponseImpl) AssertCookie(name, value string) contractshttp.Response

func (*TestResponseImpl) AssertCookieExpired

func (r *TestResponseImpl) AssertCookieExpired(name string) contractshttp.Response

func (*TestResponseImpl) AssertCookieMissing

func (r *TestResponseImpl) AssertCookieMissing(name string) contractshttp.Response

func (*TestResponseImpl) AssertCookieNotExpired

func (r *TestResponseImpl) AssertCookieNotExpired(name string) contractshttp.Response

func (*TestResponseImpl) AssertCreated

func (r *TestResponseImpl) AssertCreated() contractshttp.Response

func (*TestResponseImpl) AssertDontSee

func (r *TestResponseImpl) AssertDontSee(value []string, escaped ...bool) contractshttp.Response

func (*TestResponseImpl) AssertExactJson

func (r *TestResponseImpl) AssertExactJson(data map[string]any) contractshttp.Response

func (*TestResponseImpl) AssertFluentJson

func (r *TestResponseImpl) AssertFluentJson(callback func(json contractshttp.AssertableJSON)) contractshttp.Response

func (*TestResponseImpl) AssertForbidden

func (r *TestResponseImpl) AssertForbidden() contractshttp.Response

func (*TestResponseImpl) AssertFound

func (r *TestResponseImpl) AssertFound() contractshttp.Response

func (*TestResponseImpl) AssertGone

func (r *TestResponseImpl) AssertGone() contractshttp.Response

func (*TestResponseImpl) AssertHeader

func (r *TestResponseImpl) AssertHeader(headerName, value string) contractshttp.Response

func (*TestResponseImpl) AssertHeaderMissing

func (r *TestResponseImpl) AssertHeaderMissing(headerName string) contractshttp.Response

func (*TestResponseImpl) AssertInternalServerError

func (r *TestResponseImpl) AssertInternalServerError() contractshttp.Response

func (*TestResponseImpl) AssertJson

func (r *TestResponseImpl) AssertJson(data map[string]any) contractshttp.Response

func (*TestResponseImpl) AssertJsonMissing

func (r *TestResponseImpl) AssertJsonMissing(data map[string]any) contractshttp.Response

func (*TestResponseImpl) AssertMethodNotAllowed

func (r *TestResponseImpl) AssertMethodNotAllowed() contractshttp.Response

func (*TestResponseImpl) AssertMovedPermanently

func (r *TestResponseImpl) AssertMovedPermanently() contractshttp.Response

func (*TestResponseImpl) AssertNoContent

func (r *TestResponseImpl) AssertNoContent(status ...int) contractshttp.Response

func (*TestResponseImpl) AssertNotAcceptable

func (r *TestResponseImpl) AssertNotAcceptable() contractshttp.Response

func (*TestResponseImpl) AssertNotFound

func (r *TestResponseImpl) AssertNotFound() contractshttp.Response

func (*TestResponseImpl) AssertNotModified

func (r *TestResponseImpl) AssertNotModified() contractshttp.Response

func (*TestResponseImpl) AssertOk

func (r *TestResponseImpl) AssertOk() contractshttp.Response

func (*TestResponseImpl) AssertPartialContent

func (r *TestResponseImpl) AssertPartialContent() contractshttp.Response

func (*TestResponseImpl) AssertPaymentRequired

func (r *TestResponseImpl) AssertPaymentRequired() contractshttp.Response

func (*TestResponseImpl) AssertRequestTimeout

func (r *TestResponseImpl) AssertRequestTimeout() contractshttp.Response

func (*TestResponseImpl) AssertSee

func (r *TestResponseImpl) AssertSee(value []string, escaped ...bool) contractshttp.Response

func (*TestResponseImpl) AssertSeeInOrder

func (r *TestResponseImpl) AssertSeeInOrder(value []string, escaped ...bool) contractshttp.Response

func (*TestResponseImpl) AssertServerError

func (r *TestResponseImpl) AssertServerError() contractshttp.Response

func (*TestResponseImpl) AssertServiceUnavailable

func (r *TestResponseImpl) AssertServiceUnavailable() contractshttp.Response

func (*TestResponseImpl) AssertStatus

func (r *TestResponseImpl) AssertStatus(status int) contractshttp.Response

func (*TestResponseImpl) AssertSuccessful

func (r *TestResponseImpl) AssertSuccessful() contractshttp.Response

func (*TestResponseImpl) AssertTemporaryRedirect

func (r *TestResponseImpl) AssertTemporaryRedirect() contractshttp.Response

func (*TestResponseImpl) AssertTooManyRequests

func (r *TestResponseImpl) AssertTooManyRequests() contractshttp.Response

func (*TestResponseImpl) AssertUnauthorized

func (r *TestResponseImpl) AssertUnauthorized() contractshttp.Response

func (*TestResponseImpl) AssertUnprocessableEntity

func (r *TestResponseImpl) AssertUnprocessableEntity() contractshttp.Response

func (*TestResponseImpl) AssertUnsupportedMediaType

func (r *TestResponseImpl) AssertUnsupportedMediaType() contractshttp.Response

func (*TestResponseImpl) Content

func (r *TestResponseImpl) Content() (string, error)

func (*TestResponseImpl) Cookie

func (r *TestResponseImpl) Cookie(name string) *http.Cookie

func (*TestResponseImpl) Cookies

func (r *TestResponseImpl) Cookies() []*http.Cookie

func (*TestResponseImpl) Headers

func (r *TestResponseImpl) Headers() http.Header

func (*TestResponseImpl) IsServerError

func (r *TestResponseImpl) IsServerError() bool

func (*TestResponseImpl) IsSuccessful

func (r *TestResponseImpl) IsSuccessful() bool

func (*TestResponseImpl) Json

func (r *TestResponseImpl) Json() (map[string]any, error)

func (*TestResponseImpl) Session

func (r *TestResponseImpl) Session() (map[string]any, error)

Jump to

Keyboard shortcuts

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