httptest

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 4, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoDELETE

func DoDELETE(url string) *http.Request

func DoGET

func DoGET(url string) *http.Request

func DoPOST

func DoPOST(url, jsonReq string) *http.Request

func DoPUT

func DoPUT(url, jsonReq string) *http.Request

Types

type HttpClientTest

type HttpClientTest struct {
	Cookie   *http.Cookie
	Token    string
	Username string
	Password string
	// contains filtered or unexported fields
}

func NewClient

func NewClient() HttpClientTest

func WithBasicAuth

func WithBasicAuth(username, password string) HttpClientTest

func WithCookie

func WithCookie(name, value string) HttpClientTest

func WithTokenInHeader

func WithTokenInHeader(token string) HttpClientTest

func (HttpClientTest) DoGET

func (h HttpClientTest) DoGET(url string) *http.Request

func (HttpClientTest) DoPOST

func (h HttpClientTest) DoPOST(url, jsonReq string) *http.Request

func (HttpClientTest) DoPUT

func (h HttpClientTest) DoPUT(url, jsonReq string) *http.Request

func (HttpClientTest) WithBaseURL

func (h HttpClientTest) WithBaseURL(url string) HttpClientTest

type HttpServerTest

type HttpServerTest struct {
	// contains filtered or unexported fields
}

func OnDELETE

func OnDELETE(url string, fn echo.HandlerFunc) *HttpServerTest

func OnGET

func OnGET(url string, fn echo.HandlerFunc) *HttpServerTest

func OnPATCH

func OnPATCH(url string, fn echo.HandlerFunc) *HttpServerTest

func OnPOST

func OnPOST(url string, fn echo.HandlerFunc) *HttpServerTest

func OnPUT

func OnPUT(url string, fn echo.HandlerFunc) *HttpServerTest

func (HttpServerTest) ServeHTTP

func (h HttpServerTest) ServeHTTP(req *http.Request, data any) (*http.Response, error)

func (*HttpServerTest) Use

func (h *HttpServerTest) Use(mid echo.MiddlewareFunc) *HttpServerTest

Jump to

Keyboard shortcuts

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