Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSON ¶
DecodeJSON decodes JSON data from the provided io.Reader into the given value.
func New ¶
New creates and returns a new HTTP client with the provided context. It initializes and returns a new clientV2 pointer with an embedded http.Client pointer, an empty request pointer, and the provided context.
func NewClient ¶
NewClient creates a new HTTP client with the given context. It initializes and returns a new client pointer with an embedded http.Client pointer, an empty request pointer, and the provided context.
func UnmarshalJSON ¶
UnmarshalJSON parses the JSON-encoded data and stores the result in the value pointed to by v.
Types ¶
type GenericJSON ¶
GenericJSON represents a generic JSON object with keys of type string and values of any type. It allows flexibility in defining JSON objects with various value types.
func (GenericJSON[T]) Marshal ¶
func (gj GenericJSON[T]) Marshal() ([]byte, error)
Marshal converts the GenericJSON object to its JSON representation.
func (GenericJSON[T]) Unmarshal ¶
func (gj GenericJSON[T]) Unmarshal(v any) error
type JSON ¶
type JSON map[string]interface{}
JSON represents a JSON object.
type QueryParam ¶
type QueryParam struct { Key string // The key of the query parameter. Value any // The value of the query parameter. }
QueryParam represents a single key-value pair for query parameters.
type RequestOpts ¶
type RequestOpts struct { Headers []Header Body io.Reader QueryParams []QueryParam }