http

package
v0.0.0-...-1140765 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodPost   = http.MethodPost
	MethodGet    = http.MethodGet
	MethodPut    = http.MethodPut
	MethodDelete = http.MethodDelete
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BodyMock

type BodyMock struct {
	mock.Mock
}

func (*BodyMock) Close

func (b *BodyMock) Close() error

func (*BodyMock) Read

func (b *BodyMock) Read(p []byte) (n int, err error)

type Client

type Client interface {
	Do(req *native.Request, v interface{}) error
}

func NewClient

func NewClient(nativeClient Native, enc encoder.Factory) Client

type ClientMock

type ClientMock struct {
	mock.Mock
}

func (*ClientMock) Do

func (c *ClientMock) Do(req *http.Request, v interface{}) error

type MethodType

type MethodType string

type Native

type Native interface {
	Do(req *native.Request) (*native.Response, error)
}

type NativeMock

type NativeMock struct {
	mock.Mock
}

func (*NativeMock) Do

func (n *NativeMock) Do(req *http.Request) (*http.Response, error)

type Request

type Request interface {
	Go(ctx context.Context, v interface{}) error

	Post() Request
	Get() Request
	Put() Request
	Delete() Request
	Domain(string) Request
	Path(string) Request
}

func NewRequest

func NewRequest(client Client) Request

type RequestMock

type RequestMock struct {
	mock.Mock
}

func (*RequestMock) Delete

func (r *RequestMock) Delete() Request

func (*RequestMock) Domain

func (r *RequestMock) Domain(s string) Request

func (*RequestMock) Get

func (r *RequestMock) Get() Request

func (*RequestMock) Go

func (r *RequestMock) Go(ctx context.Context, v interface{}) error

func (*RequestMock) Path

func (r *RequestMock) Path(s string) Request

func (*RequestMock) Post

func (r *RequestMock) Post() Request

func (*RequestMock) Put

func (r *RequestMock) Put() Request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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