Documentation ¶
Overview ¶
Copyright 2019 DeepMap, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func RegisterResponseHandler(mime string, handler ResponseHandler)deprecated
- type CompletedRequestdeprecated
- type RequestBuilderdeprecated
- func NewRequest() *RequestBuilderdeprecated
- func (r *RequestBuilder) Delete(path string) *RequestBuilderdeprecated
- func (r *RequestBuilder) Get(path string) *RequestBuilderdeprecated
- func (r *RequestBuilder) Go(t *testing.T, e *echo.Echo) *CompletedRequestdeprecated
- func (r *RequestBuilder) GoWithHTTPHandler(t *testing.T, handler http.Handler) *CompletedRequestdeprecated
- func (r *RequestBuilder) Patch(path string) *RequestBuilderdeprecated
- func (r *RequestBuilder) Post(path string) *RequestBuilderdeprecated
- func (r *RequestBuilder) Put(path string) *RequestBuilderdeprecated
- func (r *RequestBuilder) WithAccept(value string) *RequestBuilderdeprecated
- func (r *RequestBuilder) WithAcceptJson() *RequestBuilderdeprecated
- func (r *RequestBuilder) WithBody(body []byte) *RequestBuilderdeprecated
- func (r *RequestBuilder) WithContentType(value string) *RequestBuilderdeprecated
- func (r *RequestBuilder) WithCookie(c *http.Cookie) *RequestBuilderdeprecated
- func (r *RequestBuilder) WithCookieNameValue(name, value string) *RequestBuilderdeprecated
- func (r *RequestBuilder) WithHeader(header, value string) *RequestBuilderdeprecated
- func (r *RequestBuilder) WithHost(value string) *RequestBuilderdeprecated
- func (r *RequestBuilder) WithJWSAuth(jws string) *RequestBuilderdeprecated
- func (r *RequestBuilder) WithJsonBody(obj interface{}) *RequestBuilderdeprecated
- func (r *RequestBuilder) WithJsonContentType() *RequestBuilderdeprecated
- func (r *RequestBuilder) WithMethod(method string, path string) *RequestBuilderdeprecated
- type ResponseHandlerdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterResponseHandler
deprecated
added in
v1.3.3
func RegisterResponseHandler(mime string, handler ResponseHandler)
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RegisterResponseHandler
Types ¶
type CompletedRequest
deprecated
type CompletedRequest struct { Recorder *httptest.ResponseRecorder // When set to true, decoders will be more strict. In the default JSON // recorder, unknown fields will cause errors. Strict bool }
CompletedRequest is the result of calling Go() on the request builder. We're wrapping the ResponseRecorder with some nice helper functions.
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#CompletedRequest
func (*CompletedRequest) Code
deprecated
func (c *CompletedRequest) Code() int
Code is a shortcut for response code
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#CompletedRequest.Code
func (*CompletedRequest) DisallowUnknownFields
deprecated
added in
v1.3.9
func (c *CompletedRequest) DisallowUnknownFields()
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#CompletedRequest.DisallowUnknownFields
func (*CompletedRequest) UnmarshalBodyToObject
deprecated
func (c *CompletedRequest) UnmarshalBodyToObject(obj interface{}) error
UnmarshalBodyToObject takes a destination object as input, and unmarshals the object in the response based on the Content-Type header.
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#CompletedRequest.UnmarshalBodyToObject
func (*CompletedRequest) UnmarshalJsonToObject
deprecated
func (c *CompletedRequest) UnmarshalJsonToObject(obj interface{}) error
UnmarshalJsonToObject assumes that the response contains JSON and unmarshals it into the specified object.
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#CompletedRequest.UnmarshalJsonToObject
type RequestBuilder
deprecated
type RequestBuilder struct { Method string Path string Headers map[string]string Body []byte Error error Cookies []*http.Cookie }
RequestBuilder caches request settings as we build up the request.
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder
func NewRequest
deprecated
func NewRequest() *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#NewRequest
func (*RequestBuilder) Delete
deprecated
func (r *RequestBuilder) Delete(path string) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.Delete
func (*RequestBuilder) Get
deprecated
func (r *RequestBuilder) Get(path string) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.Get
func (*RequestBuilder) Go
deprecated
func (r *RequestBuilder) Go(t *testing.T, e *echo.Echo) *CompletedRequest
Go performs the request, it takes a pointer to a testing context to print messages, and a pointer to an echo context for request handling.
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.GoWithHTTPHandler
func (*RequestBuilder) GoWithHTTPHandler
deprecated
added in
v1.5.0
func (r *RequestBuilder) GoWithHTTPHandler(t *testing.T, handler http.Handler) *CompletedRequest
GoWithHTTPHandler performs the request, it takes a pointer to a testing context to print messages, and a http handler for request handling.
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#GoWithHTTPHandler
func (*RequestBuilder) Patch
deprecated
added in
v1.3.5
func (r *RequestBuilder) Patch(path string) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.Patch
func (*RequestBuilder) Post
deprecated
func (r *RequestBuilder) Post(path string) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.Post
func (*RequestBuilder) Put
deprecated
func (r *RequestBuilder) Put(path string) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.Put
func (*RequestBuilder) WithAccept
deprecated
func (r *RequestBuilder) WithAccept(value string) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithAccept
func (*RequestBuilder) WithAcceptJson
deprecated
func (r *RequestBuilder) WithAcceptJson() *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithAcceptJson
func (*RequestBuilder) WithBody
deprecated
func (r *RequestBuilder) WithBody(body []byte) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithBody
func (*RequestBuilder) WithContentType
deprecated
func (r *RequestBuilder) WithContentType(value string) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithContentType
func (*RequestBuilder) WithCookie
deprecated
added in
v1.1.0
func (r *RequestBuilder) WithCookie(c *http.Cookie) *RequestBuilder
WithCookie sets a cookie
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithCookie
func (*RequestBuilder) WithCookieNameValue
deprecated
added in
v1.1.0
func (r *RequestBuilder) WithCookieNameValue(name, value string) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithCookieNameValue
func (*RequestBuilder) WithHeader
deprecated
func (r *RequestBuilder) WithHeader(header, value string) *RequestBuilder
WithHeader sets a header
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithHeader
func (*RequestBuilder) WithHost
deprecated
added in
v1.8.0
func (r *RequestBuilder) WithHost(value string) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithHost
func (*RequestBuilder) WithJWSAuth
deprecated
added in
v1.9.0
func (r *RequestBuilder) WithJWSAuth(jws string) *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithJWSAuth
func (*RequestBuilder) WithJsonBody
deprecated
func (r *RequestBuilder) WithJsonBody(obj interface{}) *RequestBuilder
WithJsonBody takes an object as input, marshals it to JSON, and sends it as the body with Content-Type: application/json
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithJsonBody
func (*RequestBuilder) WithJsonContentType
deprecated
func (r *RequestBuilder) WithJsonContentType() *RequestBuilder
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithJsonContentType
func (*RequestBuilder) WithMethod
deprecated
func (r *RequestBuilder) WithMethod(method string, path string) *RequestBuilder
WithMethod sets the method and path
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/testutil#RequestBuilder.WithMethod