Documentation
¶
Overview ¶
Package kanyerest exposes the Kanye REST API as a kit Domain.
A multi-domain host (ant) enables it with a single blank import:
import _ "github.com/tamnd/kanyerest-cli/kanyerest"
The same Domain also builds the standalone kanyerest binary.
Package kanyerest is the library behind the kanyerest command line: the HTTP client, request shaping, and the typed data models for the Kanye West quotes API at api.kanye.rest.
The API is completely open — no authentication or API key required. It paces requests and retries transient 429 and 5xx failures with exponential backoff.
Index ¶
Constants ¶
const BaseURL = "https://api.kanye.rest"
BaseURL is the root every request is built from.
const Host = "api.kanye.rest"
Host is the site this client talks to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to api.kanye.rest over HTTP.
type Config ¶
type Config struct {
BaseURL string
UserAgent string
Rate time.Duration
Timeout time.Duration
Retries int
}
Config holds all tunable parameters for the Client.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults.
type Domain ¶
type Domain struct{}
Domain is the kanyerest driver.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, hosts, and binary identity.