httpclient

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 6 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 interface {
	SetBaseUrl(baseUrl string) HTTPClient
	SetAuthToken(token string) HTTPClient
	Bearer(token string) HTTPClient
	BasicAuth(username, password string) HTTPClient
	SetHeader(key, value string) HTTPClient
	ToJson(any) HTTPClient
	ToBytesBuffer(*[]byte) HTTPClient
	ToPlainText(*string) HTTPClient
	Error(any) HTTPClient
	ContentType(string) HTTPClient
	Get(path string) (*http.Response, error)
	Post(path string, body any) (*http.Response, error)
	Put(path string, body any) (*http.Response, error)
	Delete(path string) (*http.Response, error)
}

func NewHTTPClient

func NewHTTPClient(baseURL, authToken string) HTTPClient

type HTTPClientImpl

type HTTPClientImpl struct {
	BaseURL   string
	AuthToken string

	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func (*HTTPClientImpl) BasicAuth

func (c *HTTPClientImpl) BasicAuth(username, password string) HTTPClient

func (*HTTPClientImpl) Bearer

func (c *HTTPClientImpl) Bearer(token string) HTTPClient

func (*HTTPClientImpl) ContentType

func (c *HTTPClientImpl) ContentType(contentType string) HTTPClient

func (*HTTPClientImpl) Delete

func (c *HTTPClientImpl) Delete(path string) (*http.Response, error)

func (*HTTPClientImpl) Error

func (c *HTTPClientImpl) Error(errVar any) HTTPClient

func (*HTTPClientImpl) Get

func (c *HTTPClientImpl) Get(path string) (*http.Response, error)

func (*HTTPClientImpl) Post

func (c *HTTPClientImpl) Post(path string, body any) (*http.Response, error)

func (*HTTPClientImpl) Put

func (c *HTTPClientImpl) Put(path string, body any) (*http.Response, error)

func (*HTTPClientImpl) SetAuthToken

func (c *HTTPClientImpl) SetAuthToken(token string) HTTPClient

func (*HTTPClientImpl) SetBaseUrl

func (c *HTTPClientImpl) SetBaseUrl(baseURL string) HTTPClient

func (*HTTPClientImpl) SetHeader

func (c *HTTPClientImpl) SetHeader(key, value string) HTTPClient

func (*HTTPClientImpl) ToBytesBuffer

func (c *HTTPClientImpl) ToBytesBuffer(byteArr *[]byte) HTTPClient

func (*HTTPClientImpl) ToJson

func (c *HTTPClientImpl) ToJson(respBody any) HTTPClient

func (*HTTPClientImpl) ToPlainText

func (c *HTTPClientImpl) ToPlainText(textResponse *string) HTTPClient

Jump to

Keyboard shortcuts

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