Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // BaseURL is the url to the Chuck Norris jokes API. BaseURL string // UserAgent is the user agent to use when interacting with the API. UserAgent string // contains filtered or unexported fields }
Client is an API client to the Chuck Norris jokes.
func (*Client) Categories ¶
Categories returns the list of categories.
func (*Client) RandomJoke ¶
RandomJoke returns a random joke.
type Joke ¶
type Joke struct { // IconURL is the url to the Chuck Norris API icon. IconURL string `json:"icon_url"` // Id is the id of the joke. Id string `json:"id"` // URL is the url to the joke. URL string `json:"url"` // Value contains the joke text. Value string `json:"value"` }
Joke type represents a Chuck Norris joke.
type SearchResponse ¶
type SearchResponse struct { // Total is the total number of jokes matching the search query. Total int `json:"total"` // Result is the list of jokes matching the search query. Result []Joke `json:"result"` }
SearchResponse is the response returned by the API when searching for jokes.
Click to show internal directories.
Click to hide internal directories.