package
Version:
v0.0.0-...-eab8e8a
Opens a new window with list of versions in this module.
Published: Aug 12, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Count returns the number of jokes saved in the database
FetchIfNeeded fetches jokes once per day
ForceFetch allows users to fetch new jokes on demand
LastJokeID returns id of the last joke
func LastNJokeIDs(count int) []int
LastNJokeIDs returns id of the last n jokes
type Data struct {
ID int `json:"-"`
Setup string `json:"title"`
Punchline string `json:"selftext"`
WhitelistStatus string `json:"whitelist_status"`
Score int `json:"ups"`
AdultsOnly bool `json:"over_18"`
IsVideo bool `json:"is_video"`
}
Data holds the data of a joke, not all fields will necessarily be saved to the database
GetJokeByID gets a joke by its ID
Save saves a joke to the db
Source Files
¶
Click to show internal directories.
Click to hide internal directories.