service

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient struct {
	Timeout time.Duration
}

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

func (*HTTPClient) Put

func (h *HTTPClient) Put(ctx context.Context, endpoint string, data string, parameters, headers map[string]string) (*http.Response, error)

Put http call

func (*HTTPClient) ToString

func (h *HTTPClient) ToString(response *http.Response) (string, error)

ToString response body to string

Jump to

Keyboard shortcuts

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