Versions in this module Expand all Collapse all v0 v0.0.2 Nov 8, 2022 v0.0.1 Nov 8, 2022 Changes in this version + func NewFastWebsocketDialer(handler fasthttp.RequestHandler) *websocket.Dialer + func NewJar() http.CookieJar + func NewWebsocketDialer(handler http.Handler) *websocket.Dialer + type Array struct + func NewArray(reporter Reporter, value []interface{}) *Array + func (a *Array) Contains(values ...interface{}) *Array + func (a *Array) ContainsOnly(values ...interface{}) *Array + func (a *Array) Element(index int) *Value + func (a *Array) Elements(values ...interface{}) *Array + func (a *Array) Empty() *Array + func (a *Array) Equal(value interface{}) *Array + func (a *Array) First() *Value + func (a *Array) Iter() []Value + func (a *Array) Last() *Value + func (a *Array) Length() *Number + func (a *Array) NotContains(values ...interface{}) *Array + func (a *Array) NotEmpty() *Array + func (a *Array) NotEqual(value interface{}) *Array + func (a *Array) Path(path string) *Value + func (a *Array) Raw() []interface{} + func (a *Array) Schema(schema interface{}) *Array + type AssertReporter struct + func NewAssertReporter(t assert.TestingT) *AssertReporter + func (r *AssertReporter) Errorf(message string, args ...interface{}) + type Binder struct + Handler http.Handler + TLS *tls.ConnectionState + func NewBinder(handler http.Handler) Binder + func (binder Binder) RoundTrip(origReq *http.Request) (*http.Response, error) + type Boolean struct + func NewBoolean(reporter Reporter, value bool) *Boolean + func (b *Boolean) Equal(value bool) *Boolean + func (b *Boolean) False() *Boolean + func (b *Boolean) NotEqual(value bool) *Boolean + func (b *Boolean) Path(path string) *Value + func (b *Boolean) Raw() bool + func (b *Boolean) Schema(schema interface{}) *Boolean + func (b *Boolean) True() *Boolean + type Client interface + Do func(*http.Request) (*http.Response, error) + type CompactPrinter struct + func NewCompactPrinter(logger Logger) CompactPrinter + func (CompactPrinter) Response(*http.Response, time.Duration) + func (p CompactPrinter) Request(req *http.Request) + type Config struct + BaseURL string + Client Client + Context context.Context + Printers []Printer + Reporter Reporter + RequestFactory RequestFactory + WebsocketDialer WebsocketDialer + type ContentOpts struct + Charset string + MediaType string + type Cookie struct + func NewCookie(reporter Reporter, value *http.Cookie) *Cookie + func (c *Cookie) Domain() *String + func (c *Cookie) Expires() *DateTime + func (c *Cookie) MaxAge() *Duration + func (c *Cookie) Name() *String + func (c *Cookie) Path() *String + func (c *Cookie) Raw() *http.Cookie + func (c *Cookie) Value() *String + type CurlPrinter struct + func NewCurlPrinter(logger Logger) CurlPrinter + func (CurlPrinter) Response(*http.Response, time.Duration) + func (p CurlPrinter) Request(req *http.Request) + type DateTime struct + func NewDateTime(reporter Reporter, value time.Time) *DateTime + func (dt *DateTime) Equal(value time.Time) *DateTime + func (dt *DateTime) Ge(value time.Time) *DateTime + func (dt *DateTime) Gt(value time.Time) *DateTime + func (dt *DateTime) InRange(min, max time.Time) *DateTime + func (dt *DateTime) Le(value time.Time) *DateTime + func (dt *DateTime) Lt(value time.Time) *DateTime + func (dt *DateTime) NotEqual(value time.Time) *DateTime + func (dt *DateTime) Raw() time.Time + type DebugPrinter struct + func NewDebugPrinter(logger Logger, body bool) DebugPrinter + func (p DebugPrinter) Request(req *http.Request) + func (p DebugPrinter) Response(resp *http.Response, duration time.Duration) + func (p DebugPrinter) WebsocketRead(typ int, content []byte, closeCode int) + func (p DebugPrinter) WebsocketWrite(typ int, content []byte, closeCode int) + type DefaultRequestFactory struct + func (DefaultRequestFactory) NewRequest(method, urlStr string, body io.Reader) (*http.Request, error) + type Duration struct + func NewDuration(reporter Reporter, value time.Duration) *Duration + func (d *Duration) Equal(value time.Duration) *Duration + func (d *Duration) Ge(value time.Duration) *Duration + func (d *Duration) Gt(value time.Duration) *Duration + func (d *Duration) InRange(min, max time.Duration) *Duration + func (d *Duration) IsSet() *Duration + func (d *Duration) Le(value time.Duration) *Duration + func (d *Duration) Lt(value time.Duration) *Duration + func (d *Duration) NotEqual(value time.Duration) *Duration + func (d *Duration) NotSet() *Duration + func (d *Duration) Raw() time.Duration + type Expect struct + func New(t LoggerReporter, baseURL string) *Expect + func WithConfig(config Config) *Expect + func (e *Expect) Array(value []interface{}) *Array + func (e *Expect) Boolean(value bool) *Boolean + func (e *Expect) Builder(builder func(*Request)) *Expect + func (e *Expect) DELETE(path string, pathargs ...interface{}) *Request + func (e *Expect) GET(path string, pathargs ...interface{}) *Request + func (e *Expect) HEAD(path string, pathargs ...interface{}) *Request + func (e *Expect) Matcher(matcher func(*Response)) *Expect + func (e *Expect) Number(value float64) *Number + func (e *Expect) OPTIONS(path string, pathargs ...interface{}) *Request + func (e *Expect) Object(value map[string]interface{}) *Object + func (e *Expect) PATCH(path string, pathargs ...interface{}) *Request + func (e *Expect) POST(path string, pathargs ...interface{}) *Request + func (e *Expect) PUT(path string, pathargs ...interface{}) *Request + func (e *Expect) Request(method, path string, pathargs ...interface{}) *Request + func (e *Expect) String(value string) *String + func (e *Expect) Value(value interface{}) *Value + type FastBinder struct + Handler fasthttp.RequestHandler + TLS *tls.ConnectionState + func NewFastBinder(handler fasthttp.RequestHandler) FastBinder + func (binder FastBinder) RoundTrip(stdreq *http.Request) (*http.Response, error) + type Logger interface + Logf func(fmt string, args ...interface{}) + type LoggerReporter interface + type Match struct + func NewMatch(reporter Reporter, submatches []string, names []string) *Match + func (m *Match) Empty() *Match + func (m *Match) Index(index int) *String + func (m *Match) Length() *Number + func (m *Match) Name(name string) *String + func (m *Match) NotEmpty() *Match + func (m *Match) NotValues(values ...string) *Match + func (m *Match) Raw() []string + func (m *Match) Values(values ...string) *Match + type Number struct + func NewNumber(reporter Reporter, value float64) *Number + func (n *Number) Equal(value interface{}) *Number + func (n *Number) EqualDelta(value, delta float64) *Number + func (n *Number) Ge(value interface{}) *Number + func (n *Number) Gt(value interface{}) *Number + func (n *Number) InRange(min, max interface{}) *Number + func (n *Number) Le(value interface{}) *Number + func (n *Number) Lt(value interface{}) *Number + func (n *Number) NotEqual(value interface{}) *Number + func (n *Number) NotEqualDelta(value, delta float64) *Number + func (n *Number) Path(path string) *Value + func (n *Number) Raw() float64 + func (n *Number) Schema(schema interface{}) *Number + type Object struct + func NewObject(reporter Reporter, value map[string]interface{}) *Object + func (o *Object) ContainsKey(key string) *Object + func (o *Object) ContainsMap(value interface{}) *Object + func (o *Object) Empty() *Object + func (o *Object) Equal(value interface{}) *Object + func (o *Object) Keys() *Array + func (o *Object) NotContainsKey(key string) *Object + func (o *Object) NotContainsMap(value interface{}) *Object + func (o *Object) NotEmpty() *Object + func (o *Object) NotEqual(v interface{}) *Object + func (o *Object) Path(path string) *Value + func (o *Object) Raw() map[string]interface{} + func (o *Object) Schema(schema interface{}) *Object + func (o *Object) Value(key string) *Value + func (o *Object) ValueEqual(key string, value interface{}) *Object + func (o *Object) ValueNotEqual(key string, value interface{}) *Object + func (o *Object) Values() *Array + type Printer interface + Request func(*http.Request) + Response func(*http.Response, time.Duration) + type RedirectPolicy int + const DontFollowRedirects + const FollowAllRedirects + const FollowRedirectsWithoutBody + type Reporter interface + Errorf func(message string, args ...interface{}) + type Request struct + func NewRequest(config Config, method, path string, pathargs ...interface{}) *Request + func (r *Request) Expect() *Response + func (r *Request) WithBasicAuth(username, password string) *Request + func (r *Request) WithBytes(b []byte) *Request + func (r *Request) WithChunked(reader io.Reader) *Request + func (r *Request) WithClient(client Client) *Request + func (r *Request) WithContext(ctx context.Context) *Request + func (r *Request) WithCookie(k, v string) *Request + func (r *Request) WithCookies(cookies map[string]string) *Request + func (r *Request) WithFile(key, path string, reader ...io.Reader) *Request + func (r *Request) WithFileBytes(key, path string, data []byte) *Request + func (r *Request) WithForm(object interface{}) *Request + func (r *Request) WithFormField(key string, value interface{}) *Request + func (r *Request) WithHandler(handler http.Handler) *Request + func (r *Request) WithHeader(k, v string) *Request + func (r *Request) WithHeaders(headers map[string]string) *Request + func (r *Request) WithHost(host string) *Request + func (r *Request) WithJSON(object interface{}) *Request + func (r *Request) WithMatcher(matcher func(*Response)) *Request + func (r *Request) WithMaxRedirects(maxRedirects int) *Request + func (r *Request) WithMaxRetries(maxRetries int) *Request + func (r *Request) WithMultipart() *Request + func (r *Request) WithPath(key string, value interface{}) *Request + func (r *Request) WithPathObject(object interface{}) *Request + func (r *Request) WithProto(proto string) *Request + func (r *Request) WithQuery(key string, value interface{}) *Request + func (r *Request) WithQueryObject(object interface{}) *Request + func (r *Request) WithQueryString(query string) *Request + func (r *Request) WithRedirectPolicy(policy RedirectPolicy) *Request + func (r *Request) WithRetryDelay(minDelay, maxDelay time.Duration) *Request + func (r *Request) WithRetryPolicy(policy RetryPolicy) *Request + func (r *Request) WithText(s string) *Request + func (r *Request) WithTimeout(timeout time.Duration) *Request + func (r *Request) WithTransformer(transform func(*http.Request)) *Request + func (r *Request) WithURL(urlStr string) *Request + func (r *Request) WithWebsocketDialer(dialer WebsocketDialer) *Request + func (r *Request) WithWebsocketUpgrade() *Request + type RequestFactory interface + NewRequest func(method, urlStr string, body io.Reader) (*http.Request, error) + type RequireReporter struct + func NewRequireReporter(t require.TestingT) *RequireReporter + func (r *RequireReporter) Errorf(message string, args ...interface{}) + type Response struct + func NewResponse(reporter Reporter, response *http.Response, rtt ...time.Duration) *Response + func (r *Response) Body() *String + func (r *Response) ContentEncoding(encoding ...string) *Response + func (r *Response) ContentType(mediaType string, charset ...string) *Response + func (r *Response) Cookie(name string) *Cookie + func (r *Response) Cookies() *Array + func (r *Response) Duration() *Number + func (r *Response) Form(opts ...ContentOpts) *Object + func (r *Response) Header(header string) *String + func (r *Response) Headers() *Object + func (r *Response) JSON(opts ...ContentOpts) *Value + func (r *Response) JSONP(callback string, opts ...ContentOpts) *Value + func (r *Response) NoContent() *Response + func (r *Response) Raw() *http.Response + func (r *Response) RoundTripTime() *Duration + func (r *Response) Status(status int) *Response + func (r *Response) StatusRange(rn StatusRange) *Response + func (r *Response) Text(opts ...ContentOpts) *String + func (r *Response) TransferEncoding(encoding ...string) *Response + func (r *Response) Websocket() *Websocket + type RetryPolicy int + const DontRetry + const RetryAllErrors + const RetryTemporaryNetworkAndServerErrors + const RetryTemporaryNetworkErrors + type StatusRange int + const Status1xx + const Status2xx + const Status3xx + const Status4xx + const Status5xx + type String struct + func NewString(reporter Reporter, value string) *String + func (s *String) Contains(value string) *String + func (s *String) ContainsFold(value string) *String + func (s *String) DateTime(layout ...string) *DateTime + func (s *String) Empty() *String + func (s *String) Equal(value string) *String + func (s *String) EqualFold(value string) *String + func (s *String) Length() *Number + func (s *String) Match(re string) *Match + func (s *String) MatchAll(re string) []Match + func (s *String) NotContains(value string) *String + func (s *String) NotContainsFold(value string) *String + func (s *String) NotEmpty() *String + func (s *String) NotEqual(value string) *String + func (s *String) NotEqualFold(value string) *String + func (s *String) NotMatch(re string) *String + func (s *String) Path(path string) *Value + func (s *String) Raw() string + func (s *String) Schema(schema interface{}) *String + type Value struct + func NewValue(reporter Reporter, value interface{}) *Value + func (v *Value) Array() *Array + func (v *Value) Boolean() *Boolean + func (v *Value) Equal(value interface{}) *Value + func (v *Value) NotEqual(value interface{}) *Value + func (v *Value) NotNull() *Value + func (v *Value) Null() *Value + func (v *Value) Number() *Number + func (v *Value) Object() *Object + func (v *Value) Path(path string) *Value + func (v *Value) Raw() interface{} + func (v *Value) Schema(schema interface{}) *Value + func (v *Value) String() *String + type Websocket struct + func NewWebsocket(config Config, conn WebsocketConn) *Websocket + func (c *Websocket) Close(code ...int) *Websocket + func (c *Websocket) CloseWithBytes(b []byte, code ...int) *Websocket + func (c *Websocket) CloseWithJSON(object interface{}, code ...int) *Websocket + func (c *Websocket) CloseWithText(s string, code ...int) *Websocket + func (c *Websocket) Conn() WebsocketConn + func (c *Websocket) Disconnect() *Websocket + func (c *Websocket) Expect() *WebsocketMessage + func (c *Websocket) Raw() *websocket.Conn + func (c *Websocket) Subprotocol() *String + func (c *Websocket) WithReadTimeout(timeout time.Duration) *Websocket + func (c *Websocket) WithWriteTimeout(timeout time.Duration) *Websocket + func (c *Websocket) WithoutReadTimeout() *Websocket + func (c *Websocket) WithoutWriteTimeout() *Websocket + func (c *Websocket) WriteBytesBinary(b []byte) *Websocket + func (c *Websocket) WriteBytesText(b []byte) *Websocket + func (c *Websocket) WriteJSON(object interface{}) *Websocket + func (c *Websocket) WriteMessage(typ int, content []byte, closeCode ...int) *Websocket + func (c *Websocket) WriteText(s string) *Websocket + type WebsocketConn interface + Close func() error + ReadMessage func() (messageType int, p []byte, err error) + SetReadDeadline func(t time.Time) error + SetWriteDeadline func(t time.Time) error + Subprotocol func() string + WriteMessage func(messageType int, data []byte) error + type WebsocketDialer interface + Dial func(url string, reqH http.Header) (*websocket.Conn, *http.Response, error) + type WebsocketMessage struct + func NewWebsocketMessage(reporter Reporter, typ int, content []byte, closeCode ...int) *WebsocketMessage + func (m *WebsocketMessage) BinaryMessage() *WebsocketMessage + func (m *WebsocketMessage) Body() *String + func (m *WebsocketMessage) CloseMessage() *WebsocketMessage + func (m *WebsocketMessage) Code(code ...int) *WebsocketMessage + func (m *WebsocketMessage) JSON() *Value + func (m *WebsocketMessage) NoContent() *WebsocketMessage + func (m *WebsocketMessage) NotBinaryMessage() *WebsocketMessage + func (m *WebsocketMessage) NotCloseMessage() *WebsocketMessage + func (m *WebsocketMessage) NotCode(code ...int) *WebsocketMessage + func (m *WebsocketMessage) NotTextMessage() *WebsocketMessage + func (m *WebsocketMessage) NotType(typ ...int) *WebsocketMessage + func (m *WebsocketMessage) Raw() (typ int, content []byte, closeCode int) + func (m *WebsocketMessage) TextMessage() *WebsocketMessage + func (m *WebsocketMessage) Type(typ ...int) *WebsocketMessage + type WebsocketPrinter interface + WebsocketRead func(typ int, content []byte, closeCode int) + WebsocketWrite func(typ int, content []byte, closeCode int)