client

package
v0.2.65 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 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 AuthenticatedClient

type AuthenticatedClient struct {
	// contains filtered or unexported fields
}

AuthenticatedClient wraps http.Client with automatic OAuth authentication

func NewAuthenticatedClient

func NewAuthenticatedClient(cfg *config.Config) (*AuthenticatedClient, error)

NewAuthenticatedClient creates a new authenticated HTTP client

func (*AuthenticatedClient) Delete

func (c *AuthenticatedClient) Delete(ctx context.Context, path string) (*http.Response, error)

Delete performs a DELETE request to the specified path

func (*AuthenticatedClient) Do

Do performs an HTTP request with automatic authentication and retry on 401

func (*AuthenticatedClient) Get

Get performs a GET request to the specified path

func (*AuthenticatedClient) Post

func (c *AuthenticatedClient) Post(ctx context.Context, path string, body io.Reader) (*http.Response, error)

Post performs a POST request to the specified path with the given body

func (*AuthenticatedClient) Put

func (c *AuthenticatedClient) Put(ctx context.Context, path string, body io.Reader) (*http.Response, error)

Put performs a PUT request to the specified path with the given body

type HTTPClient added in v0.2.24

type HTTPClient struct {
	// contains filtered or unexported fields
}

HTTPClient wraps http.Client with additional features

func NewHTTPClient added in v0.2.24

func NewHTTPClient() *HTTPClient

NewHTTPClient creates a new HTTP client with sensible defaults

func (*HTTPClient) Do added in v0.2.24

func (c *HTTPClient) Do(req *http.Request) (*http.Response, error)

Do executes an HTTP request with retry logic

func (*HTTPClient) DoWithContext added in v0.2.24

func (c *HTTPClient) DoWithContext(ctx context.Context, req *http.Request) (*http.Response, error)

DoWithContext executes an HTTP request with a custom context

func (*HTTPClient) Get added in v0.2.24

func (c *HTTPClient) Get(url string) (*http.Response, error)

Get performs a GET request with retry logic

func (*HTTPClient) GetWithContext added in v0.2.24

func (c *HTTPClient) GetWithContext(ctx context.Context, url string) (*http.Response, error)

GetWithContext performs a GET request with context

func (*HTTPClient) WithRetries added in v0.2.24

func (c *HTTPClient) WithRetries(maxRetries int, retryDelay time.Duration) *HTTPClient

WithRetries sets custom retry parameters

func (*HTTPClient) WithTimeout added in v0.2.24

func (c *HTTPClient) WithTimeout(timeout time.Duration) *HTTPClient

WithTimeout sets a custom timeout for the client

Jump to

Keyboard shortcuts

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