twirptest

package
v0.0.0-...-5b4c5eb Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SendRequest(
		ctx context.Context,
		t *testing.T,
		handler http.Handler,
		path string,
		request proto.Message,
		response proto.Message,
		wantStatusCode int,
	) (int, *JSONError)
}

type JSONClient

type JSONClient struct{}

func NewJSONClient

func NewJSONClient() *JSONClient

func (*JSONClient) SendRequest

func (jc *JSONClient) SendRequest(
	ctx context.Context,
	t *testing.T,
	handler http.Handler,
	path string,
	request proto.Message,
	response proto.Message,
) (int, error)

type JSONError

type JSONError struct {
	Code string            `json:"code"`
	Msg  string            `json:"msg"`
	Meta map[string]string `json:"meta,omitempty"`
}

func (*JSONError) Error

func (e *JSONError) Error() string

Jump to

Keyboard shortcuts

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