Documentation
¶
Overview ¶
Package dogapi is the library behind the dogapi command line: the HTTP client, request shaping, and typed data models for the Dog CEO's Dog API (dog.ceo).
No API key is required. The client paces requests and retries on transient errors so a busy session stays polite.
Index ¶
Constants ¶
const Host = "dog.ceo"
Host is the site this client talks to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Breed ¶
type Breed struct {
Name string `kit:"id" json:"name"`
SubBreeds string `json:"sub_breeds"` // comma-joined list of sub-breed names, or "" if none
}
Breed is a single dog breed entry.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to dog.ceo over HTTP.
func (*Client) ListBreeds ¶
ListBreeds fetches all dog breeds sorted alphabetically.
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 dogapi driver.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, the hostnames a pasted link is matched against, and the identity reused for the binary's help and version.