Documentation ¶
Index ¶
- func FieldSpec(extraChildren ...docs.FieldSpec) docs.FieldSpec
- func OptSetCloseChan(c <-chan struct{}) func(*Type)deprecated
- func OptSetHTTPTransport(transport *http.Transport) func(*Type)
- func OptSetLogger(log log.Modular) func(*Type)deprecated
- func OptSetManager(mgr types.Manager) func(*Type)
- func OptSetRoundTripper(rt http.RoundTripper) func(*Type)deprecated
- func OptSetStats(stats metrics.Type) func(*Type)deprecated
- func UnexpectedErr(res *http.Response) error
- type Config
- type Typedeprecated
- func (h *Type) CloseAsync()deprecated
- func (h *Type) CreateRequest(msg types.Message) (req *http.Request, err error)deprecated
- func (h *Type) Do(msg types.Message) (*http.Response, error)deprecated
- func (h *Type) DoWithContext(ctx context.Context, msg types.Message) (res *http.Response, err error)deprecated
- func (h *Type) ParseResponse(res *http.Response) (resMsg types.Message, err error)deprecated
- func (h *Type) Send(msg types.Message) (types.Message, error)deprecated
- func (h *Type) SendWithContext(ctx context.Context, msg types.Message) (types.Message, error)deprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldSpec ¶ added in v3.61.0
FieldSpec returns the field spec for an HTTP type. TODO: V4 Remove this
func OptSetCloseChan
deprecated
func OptSetCloseChan(c <-chan struct{}) func(*Type)
OptSetCloseChan sets a channel that when closed will interrupt any blocking calls within the client.
Deprecated: This component is no longer used by Benthos, instead look at ./internal/http.
func OptSetHTTPTransport ¶
OptSetHTTPTransport sets the HTTP Transport to use. NOTE: This setting will override any configured TLS options.
WARNING: DEPRECATED, use OptSetRoundTripper instead. TODO: V4 Remove this
func OptSetLogger
deprecated
func OptSetManager ¶
OptSetManager sets the manager to use.
func OptSetRoundTripper
deprecated
added in
v3.17.0
func OptSetRoundTripper(rt http.RoundTripper) func(*Type)
OptSetRoundTripper sets the *client.Transport to use for HTTP requests. NOTE: This setting will override any configured TLS options.
Deprecated: This component is no longer used by Benthos, instead look at ./internal/http.
func OptSetStats
deprecated
func UnexpectedErr ¶ added in v3.57.0
UnexpectedErr get error body
Types ¶
type Config ¶
type Config struct { URL string `json:"url" yaml:"url"` Verb string `json:"verb" yaml:"verb"` Headers map[string]string `json:"headers" yaml:"headers"` Metadata metadata.IncludeFilterConfig `json:"metadata" yaml:"metadata"` CopyResponseHeaders bool `json:"copy_response_headers" yaml:"copy_response_headers"` ExtractMetadata metadata.IncludeFilterConfig `json:"extract_headers" yaml:"extract_headers"` RateLimit string `json:"rate_limit" yaml:"rate_limit"` Timeout string `json:"timeout" yaml:"timeout"` Retry string `json:"retry_period" yaml:"retry_period"` MaxBackoff string `json:"max_retry_backoff" yaml:"max_retry_backoff"` NumRetries int `json:"retries" yaml:"retries"` BackoffOn []int `json:"backoff_on" yaml:"backoff_on"` DropOn []int `json:"drop_on" yaml:"drop_on"` SuccessfulOn []int `json:"successful_on" yaml:"successful_on"` TLS tls.Config `json:"tls" yaml:"tls"` ProxyURL string `json:"proxy_url" yaml:"proxy_url"` auth.Config `json:",inline" yaml:",inline"` OAuth2 auth.OAuth2Config `json:"oauth2" yaml:"oauth2"` }
Config is a configuration struct for an HTTP client.
type Type
deprecated
type Type struct {
// contains filtered or unexported fields
}
Type is an output type that pushes messages to Type.
Deprecated: This component is no longer used by Benthos, instead look at ./internal/http.
func (*Type) CloseAsync
deprecated
added in
v3.30.0
func (h *Type) CloseAsync()
CloseAsync closes the HTTP client and all managed resources.
Deprecated: This component is no longer used by Benthos, instead look at ./internal/http.
func (*Type) Do
deprecated
Do attempts to create and perform an HTTP request from a message payload. This attempt may include retries, and if all retries fail an error is returned.
Deprecated: This component is no longer used by Benthos, instead look at ./internal/http.
func (*Type) Send
deprecated
Send attempts to send a message to an HTTP server, this attempt may include retries, and if all retries fail an error is returned. The message payload can be nil, in which case an empty body is sent. The response will be parsed back into a message, meaning mulitpart content handling is done for you.
If the response body is empty the message returned is nil.
Deprecated: This component is no longer used by Benthos, instead look at ./internal/http.