client

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrCacheMiss = errors.New("cache miss")
)

Functions

func RateLimit

func RateLimit(host string)

Types

type Config

type Config struct {
	UserAgent string
	CacheDir  string
	MaxAge    time.Duration
}

func (*Config) Merge

func (c *Config) Merge(o Config)

type Getter

type Getter interface {
	Get(url string) (http.Header, []byte, error)
	GetJson(url string, result interface{}) error
	GetJsonWith(headers map[string]string, url string, result interface{}) error
	GetXML(url string, result interface{}) error
	GetPLS(url string) (pls.Playlist, error)
}

func NewCacheOnlyGetter

func NewCacheOnlyGetter(config Config) Getter

func NewGetter

func NewGetter(config Config) Getter

Jump to

Keyboard shortcuts

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