testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(v bool) *bool

func Float64Ptr

func Float64Ptr(v float64) *float64

func IDPtr

func IDPtr(v models.ID) *models.ID

func IntPtr

func IntPtr(v int) *int

func ParseISO8601Timestamp

func ParseISO8601Timestamp(t testing.TB, timestamp string) *time.Time

func StringPtr

func StringPtr(v string) *string

func TimePtr

func TimePtr(v time.Time) *time.Time

func UnmarshalJSONToIf

func UnmarshalJSONToIf(t testing.TB, jsonString string) interface{}

Types

type SpyHTTPHandler

type SpyHTTPHandler struct {
	RequestsCount   int
	LastMethod      string
	LastURL         *url.URL
	LastHeader      http.Header
	LastRequestBody string
	// contains filtered or unexported fields
}

func NewSpyHTTPHandler

func NewSpyHTTPHandler(t testing.TB, responseCode int, responseBody []byte) *SpyHTTPHandler

func (*SpyHTTPHandler) ServeHTTP

func (s *SpyHTTPHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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