apeutil

package
v1.7.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestWithURLParams

func RequestWithURLParams(body []byte, params map[string]string) *http.Request

RequestWithURLParams builds http.Request with body and injects chi urlparams, useful for tests

Types

type Signer

type Signer interface {
	SignRequest(r *http.Request) error
}

type TestClient

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

func NewClient

func NewClient(t *testing.T, ts *httptest.Server) *TestClient

func (*TestClient) Delete

func (c *TestClient) Delete(path, body string) *http.Response

func (*TestClient) Do

func (c *TestClient) Do(method, path, body string) *http.Response

func (*TestClient) Get

func (c *TestClient) Get(path string) *http.Response

func (*TestClient) Patch

func (c *TestClient) Patch(path, body string) *http.Response

func (*TestClient) Post

func (c *TestClient) Post(path, body string) *http.Response

func (*TestClient) Put

func (c *TestClient) Put(path, body string) *http.Response

func (*TestClient) SetSigner

func (c *TestClient) SetSigner(signer Signer) *TestClient

func (TestClient) WithClaims

func (c TestClient) WithClaims(claims jwt.Claims) *TestClient

Jump to

Keyboard shortcuts

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