Documentation ¶
Index ¶
- type JokeAPI
- func (j *JokeAPI) Fetch() (JokesResp, error)
- func (j *JokeAPI) FetchWithContext(ctx context.Context) (JokesResp, error)
- func (j *JokeAPI) Set(params Params)
- func (j *JokeAPI) SetBlacklist(b []string)
- func (j *JokeAPI) SetCategories(ctgs []string)
- func (j *JokeAPI) SetJokeType(s string)
- func (j *JokeAPI) SetLang(lang string)
- func (j *JokeAPI) SetParams(ctgs []string, blacklist []string, joketype string, lang string)
- type JokesResp
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JokeAPI ¶
type JokeAPI struct {
ExportedParams Params
}
JokeAPI struct
func (*JokeAPI) Fetch ¶
Fetch gets the content with respect to the parameters. Use FetchWithContext to add your custom context.
func (*JokeAPI) FetchWithContext ¶
FetchWithContext gets the content with respect to the parameters. Accepts a context.Context.
func (*JokeAPI) SetBlacklist ¶
SetBlacklist sets joke blacklist. Common blacklists are nsfw | religious | political | racist | sexist | explicit
func (*JokeAPI) SetCategories ¶
SetCategories sets joke categories. Common categories are Programming | Misc | Spooky | Dark | Fun
func (*JokeAPI) SetLang ¶
SetLang sets language. Go to https://v2.jokeapi.dev/languages?format=txt to select your preferable language format. By default its en (English). Note that (as of now) most jokes are available in en and de only and setting other languages will give a corresponding error