Documentation ¶
Index ¶
- type Connector
- type HttpAuthenticator
- type HttpBodyBuilder
- type HttpConnector
- func (c *HttpConnector) Request() (io.ReadCloser, error)
- func (c *HttpConnector) RequestBytes() ([]byte, error)
- func (c *HttpConnector) RequestString() (string, error)
- func (c *HttpConnector) SetAuthenticator(authenticator HttpAuthenticator)
- func (c *HttpConnector) SetBody(body any)
- func (c *HttpConnector) SetHeaders(headers map[string]string)
- func (c *HttpConnector) SetMethod(method string)
- func (c *HttpConnector) SetTimeout(timeout time.Duration)
- func (c *HttpConnector) SetUrl(url string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector interface {
Request() (io.ReadCloser, error)
}
type HttpAuthenticator ¶
type HttpAuthenticator interface {
Authenticate(connector *HttpConnector, req *http.Request) error
}
type HttpBodyBuilder ¶
type HttpConnector ¶
type HttpConnector struct { Method string Url string Headers map[string]string Body any Authenticator HttpAuthenticator Timeout time.Duration }
func NewHttpGetConnector ¶
func NewHttpGetConnector(url string) *HttpConnector
Build and Connector for HTTP GET requests.
func NewHttpPostConnector ¶
func NewHttpPostConnector( url string, body any, ) *HttpConnector
Build and Connector for HTTP POST requests.
func (*HttpConnector) Request ¶
func (c *HttpConnector) Request() (io.ReadCloser, error)
func (*HttpConnector) RequestBytes ¶
func (c *HttpConnector) RequestBytes() ([]byte, error)
func (*HttpConnector) RequestString ¶
func (c *HttpConnector) RequestString() (string, error)
func (*HttpConnector) SetAuthenticator ¶
func (c *HttpConnector) SetAuthenticator(authenticator HttpAuthenticator)
func (*HttpConnector) SetBody ¶
func (c *HttpConnector) SetBody(body any)
func (*HttpConnector) SetHeaders ¶
func (c *HttpConnector) SetHeaders(headers map[string]string)
func (*HttpConnector) SetMethod ¶
func (c *HttpConnector) SetMethod(method string)
func (*HttpConnector) SetTimeout ¶
func (c *HttpConnector) SetTimeout(timeout time.Duration)
func (*HttpConnector) SetUrl ¶
func (c *HttpConnector) SetUrl(url string)
Click to show internal directories.
Click to hide internal directories.