Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssertableJSON ¶
type AssertableJSON interface {
Count(key string, value int) AssertableJSON
First(key string, callback func(AssertableJSON)) AssertableJSON
Each(key string, callback func(AssertableJSON)) AssertableJSON
Has(key string) AssertableJSON
HasAll(keys []string) AssertableJSON
HasAny(keys []string) AssertableJSON
HasWithScope(key string, length int, callback func(AssertableJSON)) AssertableJSON
Json() map[string]any
Missing(key string) AssertableJSON
MissingAll(keys []string) AssertableJSON
Where(key string, value any) AssertableJSON
WhereNot(key string, value any) AssertableJSON
}
type Request ¶
type Request interface {
Get(uri string) (Response, error)
Post(uri string, body io.Reader) (Response, error)
Put(uri string, body io.Reader) (Response, error)
Delete(uri string, body io.Reader) (Response, error)
Patch(uri string, body io.Reader) (Response, error)
Head(uri string) (Response, error)
Options(uri string) (Response, error)
Bind(value any) Request
FlushHeaders() Request
WithBasicAuth(username, password string) Request
WithContext(ctx context.Context) Request
WithCookies(cookies []*http.Cookie) Request
WithCookie(cookie *http.Cookie) Request
WithHeader(key, value string) Request
WithHeaders(headers map[string]string) Request
WithoutHeader(key string) Request
WithToken(token string, ttype ...string) Request
WithoutToken() Request
WithSession(attributes map[string]any) Request
}
type Response ¶
type Response interface {
Content() (string, error)
Cookie(name string) *http.Cookie
Cookies() []*http.Cookie
Headers() http.Header
IsServerError() bool
IsSuccessful() bool
Json() (map[string]any, error)
Session() (map[string]any, error)
AssertStatus(status int) Response
AssertOk() Response
AssertCreated() Response
AssertAccepted() Response
AssertNoContent(status ...int) Response
AssertMovedPermanently() Response
AssertFound() Response
AssertNotModified() Response
AssertPartialContent() Response
AssertTemporaryRedirect() Response
AssertBadRequest() Response
AssertPaymentRequired() Response
AssertForbidden() Response
AssertNotFound() Response
AssertMethodNotAllowed() Response
AssertNotAcceptable() Response
AssertConflict() Response
AssertRequestTimeout() Response
AssertGone() Response
AssertUnsupportedMediaType() Response
AssertUnprocessableEntity() Response
AssertTooManyRequests() Response
AssertInternalServerError() Response
AssertHeader(headerName, value string) Response
AssertHeaderMissing(string) Response
AssertCookie(name, value string) Response
AssertCookieExpired(string) Response
AssertCookieNotExpired(string) Response
AssertCookieMissing(string) Response
AssertSuccessful() Response
AssertServerError() Response
AssertDontSee([]string, ...bool) Response
AssertSee([]string, ...bool) Response
AssertSeeInOrder([]string, ...bool) Response
AssertJson(map[string]any) Response
AssertExactJson(map[string]any) Response
AssertJsonMissing(map[string]any) Response
AssertFluentJson(func(json AssertableJSON)) Response
}
Click to show internal directories.
Click to hide internal directories.