Documentation ¶
Index ¶
- Variables
- func Drain(r *http.Response)
- func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error)
- func PostJSON(ctx context.Context, client *http.Client, url string, body io.Reader) (*http.Response, error)
- func PostText(ctx context.Context, client *http.Client, url string, body io.Reader) (*http.Response, error)
- func RedactURL(err error) error
- func UploadFile(accessKey, secretKey, endpoint, bucket, region string, plot io.WriterTo) (string, error)
- type MultiError
Constants ¶
This section is empty.
Variables ¶
View Source
var UserAgentHeader = fmt.Sprintf("Promoter/%s", version.Version)
Functions ¶
func Drain ¶
Drain consumes and closes the response's body to make sure that the HTTP client can reuse existing connections.
func PostJSON ¶
func PostJSON(ctx context.Context, client *http.Client, url string, body io.Reader) (*http.Response, error)
PostJSON sends a POST request with JSON payload to the given URL.
func PostText ¶
func PostText(ctx context.Context, client *http.Client, url string, body io.Reader) (*http.Response, error)
PostText sends a POST request with text payload to the given URL.
Types ¶
type MultiError ¶
type MultiError struct {
// contains filtered or unexported fields
}
MultiError contains multiple errors and implements the error interface. Its zero value is ready to use. All its methods are goroutine safe.
func (*MultiError) Error ¶
func (e *MultiError) Error() string
func (*MultiError) Errors ¶
func (e *MultiError) Errors() []error
Errors returns the errors added to the MuliError. The returned slice is a copy of the internal slice of errors.
func (*MultiError) Len ¶
func (e *MultiError) Len() int
Len returns the number of errors added to the MultiError.
Click to show internal directories.
Click to hide internal directories.