client

package
v0.0.0-...-24e51bd Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: AGPL-3.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DirectiveMaxAge       = "max-age"
	DirectiveOnlyIfCached = "only-if-cached"
)

Variables

View Source
var (
	HeaderUserAgent    = http.CanonicalHeaderKey("User-Agent")
	HeaderCacheControl = http.CanonicalHeaderKey("Cache-Control")
	ErrCacheMiss       = errors.New("cache miss")
)

Functions

func RateLimit

func RateLimit(host string)

Types

type Client

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

func NewClient

func NewClient(config *config.ClientConfig) *Client

func (*Client) Get

func (c *Client) Get(url string) (http.Header, []byte, error)

func (*Client) GetJson

func (c *Client) GetJson(url string, result interface{}) error

func (*Client) GetJsonWith

func (c *Client) GetJsonWith(headers map[string]string, url string, result interface{}) error

func (*Client) GetPLS

func (c *Client) GetPLS(urlString string) (pls.Playlist, error)

func (*Client) GetWith

func (c *Client) GetWith(headers map[string]string, url string) (http.Header, []byte, error)

func (*Client) GetXML

func (c *Client) GetXML(urlString string, result interface{}) error

func (*Client) UseOnlyIfCached

func (c *Client) UseOnlyIfCached(enabled bool)

Jump to

Keyboard shortcuts

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