Documentation
¶
Index ¶
- type HTTPClient
- func (h *HTTPClient) BuildData(parameters map[string]string) string
- func (h *HTTPClient) Delete(ctx context.Context, endpoint string, parameters, headers map[string]string) (*http.Response, error)
- func (h *HTTPClient) Get(ctx context.Context, endpoint string, parameters, headers map[string]string) (*http.Response, error)
- func (h *HTTPClient) GetHeaderValue(response *http.Response, key string) string
- func (h *HTTPClient) GetStatusCode(response *http.Response) int
- func (h *HTTPClient) Patch(ctx context.Context, endpoint string, data string, ...) (*http.Response, error)
- func (h *HTTPClient) Post(ctx context.Context, endpoint string, data string, ...) (*http.Response, error)
- func (h *HTTPClient) Put(ctx context.Context, endpoint string, data string, ...) (*http.Response, error)
- func (h *HTTPClient) ToString(response *http.Response) (string, error)
- type Prometheus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
HTTPClient struct
func NewHTTPClient ¶
func NewHTTPClient(timeout int) *HTTPClient
NewHTTPClient creates an instance of http client
func (*HTTPClient) BuildData ¶
func (h *HTTPClient) BuildData(parameters map[string]string) string
BuildData build body data
func (*HTTPClient) Delete ¶
func (h *HTTPClient) Delete(ctx context.Context, endpoint string, parameters, headers map[string]string) (*http.Response, error)
Delete http call
func (*HTTPClient) Get ¶
func (h *HTTPClient) Get(ctx context.Context, endpoint string, parameters, headers map[string]string) (*http.Response, error)
Get http call
func (*HTTPClient) GetHeaderValue ¶
func (h *HTTPClient) GetHeaderValue(response *http.Response, key string) string
GetHeaderValue get response header value
func (*HTTPClient) GetStatusCode ¶
func (h *HTTPClient) GetStatusCode(response *http.Response) int
GetStatusCode response status code
func (*HTTPClient) Patch ¶
func (h *HTTPClient) Patch(ctx context.Context, endpoint string, data string, parameters, headers map[string]string) (*http.Response, error)
Patch http call
func (*HTTPClient) Post ¶
func (h *HTTPClient) Post(ctx context.Context, endpoint string, data string, parameters, headers map[string]string) (*http.Response, error)
Post http call
type Prometheus ¶ added in v0.1.1
type Prometheus struct{}
Prometheus struct
func NewPrometheus ¶ added in v0.1.1
func NewPrometheus() *Prometheus
NewPrometheus create a new instance of prometheus backend
func (*Prometheus) Counter ¶ added in v0.1.1
func (p *Prometheus) Counter(item model.Metric) error
Counter updates or creates a counter
func (*Prometheus) Gauge ¶ added in v0.1.1
func (p *Prometheus) Gauge(item model.Metric) error
Gauge updates or creates a gauge
func (*Prometheus) Histogram ¶ added in v0.1.1
func (p *Prometheus) Histogram(item model.Metric) error
Histogram updates or creates a histogram
Click to show internal directories.
Click to hide internal directories.