curlier

package
v0.0.0-...-144e09d Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTransientError

func IsTransientError(code int) bool

func ParseHeaderArgument

func ParseHeaderArgument(header *http.Header, h string) (key string, err error)

Types

type Curlier

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

func NewCurlier

func NewCurlier(cfg *CurlierConfig) (*Curlier, error)

func (*Curlier) Run

func (inst *Curlier) Run(reqBody io.Reader) (resp *http.Response, err error)

type CurlierConfig

type CurlierConfig struct {
	Request string   `json:"request"`
	Url     string   `json:"url"`
	Headers []string `json:"headers"`

	Insecure bool `json:"insecure"`

	User  string `json:"user"`
	Basic bool   `json:"basic"`

	ConnectTimeout float64 `json:"connectionTimeout"`
	MaxTime        float64 `json:"maxTime"`

	MaxRedirs    int     `json:"maxRedirs"`
	RetryDelay   float64 `json:"retryDelay"`
	RetryMaxTime float64 `json:"retryMaxTime"`

	Retry int `json:"retry"`
	// contains filtered or unexported fields
}

func (*CurlierConfig) FromContext

func (inst *CurlierConfig) FromContext(nameTransf config.NameTransformFunc, ctx *cli.Context) (nMessages int)

func (*CurlierConfig) GetHeaders

func (inst *CurlierConfig) GetHeaders() (keys []string, header *http.Header, err error)

func (*CurlierConfig) ToCliFlags

func (inst *CurlierConfig) ToCliFlags(nameTransf config.NameTransformFunc, envVarNameTransf config.NameTransformFunc) []cli.Flag

func (*CurlierConfig) Validate

func (inst *CurlierConfig) Validate(force bool) (nMessages int)

Jump to

Keyboard shortcuts

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