internal

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &types.GnsConfig{
	Timeout: 10 * time.Second,
}

Functions

func ParseResponse

func ParseResponse(resp *http.Response) (types.RawResponse, error)

ParseResponse parses the HTTP response into types.RawResponse. This is primarily used for the Stats API. Caution: remember to close resp.Body in the caller function.

func ParseResponseTo

func ParseResponseTo(resp *http.Response, target any) error

ParseResponseTo parses the HTTP response into the provided target. It handles gzip decompression if necessary. Caution: remember to close resp.Body in the caller function.

Types

type HttpClient

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

func (*HttpClient) Get

func (c *HttpClient) Get(path string, headers *http.Header) (*http.Response, error)

type IHttpClient

type IHttpClient interface {
	Get(path string, headers *http.Header) (*http.Response, error)
}

func NewHttpClient

func NewHttpClient(config *types.GnsConfig) IHttpClient

Jump to

Keyboard shortcuts

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