http_client

package
v0.3.32 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 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 Client

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

Client is the custom HTTP client

func NewClient

func NewClient(timeout time.Duration) *Client

NewClient creates a new HTTP client with the specified timeout

func (*Client) Delete

func (c *Client) Delete(url string, headers map[string]string) (*http.Response, error)

Delete sends a DELETE request

func (*Client) DoRequest

func (c *Client) DoRequest(method, url string, headers map[string]string, body interface{}) (*http.Response, error)

DoRequest is a generic method to handle all HTTP methods

func (*Client) Get

func (c *Client) Get(url string, headers map[string]string) (*http.Response, error)

Get sends a GET request

func (*Client) Post

func (c *Client) Post(url string, headers map[string]string, body interface{}) (*http.Response, error)

Post sends a POST request

func (*Client) Put

func (c *Client) Put(url string, headers map[string]string, body interface{}) (*http.Response, error)

Put sends a PUT request

type SSEClient

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

SSEClient handles Server-Sent Events

func NewSSEClient

func NewSSEClient(timeout time.Duration) *SSEClient

NewSSEClient creates a new SSE client

func (*SSEClient) Listen

func (s *SSEClient) Listen(url string) error

Listen listens for SSE events from the specified URL

Jump to

Keyboard shortcuts

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