deliverer

package
v0.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = time.Second * 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Deliverer

type Deliverer interface {
	Deliver(req *Request) (res *Response, err error)
}

type HTTPDeliverer

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

HTTPDeliverer delivers via HTTP

func NewHTTPDeliverer

func NewHTTPDeliverer(client *http.Client) *HTTPDeliverer

func (*HTTPDeliverer) Deliver

func (d *HTTPDeliverer) Deliver(req *Request) (res *Response, err error)

type Request

type Request struct {
	URL     string
	Method  string
	Payload []byte
	Headers map[string]string
}

Request is HTTP request

type Response

type Response struct {
	Status       string
	StatusCode   int
	Header       http.Header
	ResponseBody []byte
	Request      *Request
	// contains filtered or unexported fields
}

Response is HTTP response

func (*Response) Is2xx

func (r *Response) Is2xx() bool

func (*Response) String

func (r *Response) String() string

Jump to

Keyboard shortcuts

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