apitest

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package apitest are functions for testing any API (not just Echo).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequest

func GetRequest(url string, opts ...RequestOption) *http.Request

func MustMarshal

func MustMarshal(o interface{}) []byte

func MustUnmarshal

func MustUnmarshal(s string) interface{}

func MustUnmarshalFrom

func MustUnmarshalFrom(r io.Reader) interface{}

func NewRequest

func NewRequest(method, url string, body []byte, opts ...RequestOption) *http.Request

Types

type RequestOption

type RequestOption func(*http.Request)

func JsonReq

func JsonReq() RequestOption

func SetQueryParam

func SetQueryParam(key string, value interface{}) RequestOption

func SetQueryParams

func SetQueryParams(values map[string]interface{}) RequestOption

func SetReqHeader

func SetReqHeader(key, value string) RequestOption

Jump to

Keyboard shortcuts

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