internal

package
v0.0.0-...-0b0a46d Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildUrl

func BuildUrl(baseUrl string, path string, pathParams map[string]any, queryParams map[string][]any) (string, error)

func HttpClient

func HttpClient(withcache bool, ttl *time.Duration) *http.Client

HttpClient creates an HTTP client with GET request caching.

Types

type CachingTransport

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

CachingTransport is an http.RoundTripper that adds caching for GET requests.

func NewCachingTransport

func NewCachingTransport(transport http.RoundTripper, ttl time.Duration) *CachingTransport

NewCachingTransport creates a new CachingTransport.

func (*CachingTransport) RoundTrip

func (ct *CachingTransport) RoundTrip(req *http.Request) (resp *http.Response, ferr error)

RoundTrip executes a single HTTP transaction, possibly returning a cached response.

type Stringer

type Stringer interface {
	String() string
}

Jump to

Keyboard shortcuts

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