httpclient

package
v0.0.0-...-a9c572d Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient struct {
	Client      *http.Client
	RetryConfig *HTTPRetryConfig
}

func NewHTTPClient

func NewHTTPClient() (*HTTPClient, error)

func (*HTTPClient) DoHttpRequest

func (c *HTTPClient) DoHttpRequest(ctx context.Context, req *PushRequest) (*PushResponse, error)

type HTTPOption

type HTTPOption func(r *http.Request)

func SetHeader

func SetHeader(key string, value string) HTTPOption

type HTTPRetryConfig

type HTTPRetryConfig struct {
	MaxRetryTimes int
	RetryInterval time.Duration
}

type PushRequest

type PushRequest struct {
	Method string
	URL    string
	Body   []byte
	Header []HTTPOption
}

type PushResponse

type PushResponse struct {
	Status int
	Header http.Header
	Body   []byte
}

Jump to

Keyboard shortcuts

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