Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertContentToItems(content Content) (chan Item, error)
- func GetBooksContent(page int, list *[]Content) (isLastPage bool, err error)
- func GetCategoryItemsAsJSON(category Category) string
- func GetComicsContent(page int, list *[]Content) (isLastPage bool, err error)
- func GetGameAssetsContent(page int, list *[]Content) (isLastPage bool, err error)
- func GetGameModsContent(page int, list *[]Content) (isLastPage bool, err error)
- func GetGamesContent(page int, list *[]Content) (isLastPage bool, err error)
- func GetMiscContent(page int, list *[]Content) (isLastPage bool, err error)
- func GetPhysicalGamesContent(page int, list *[]Content) (isLastPage bool, err error)
- func GetSoundtracksContent(page int, list *[]Content) (isLastPage bool, err error)
- func GetToolsContent(page int, list *[]Content) (isLastPage bool, err error)
- type Category
- type Content
- type GetCategoryContentFn
- type Item
Constants ¶
const ( GameAssets Category = "game-assets" Books = "books" Comics = "comics" Tools = "tools" Games = "games" PhysicalGames = "physical-games" Soundtracks = "soundtracks" GameMods = "game-mods" Misc = "misc" )
Enum for all categories that can be found on itch.io
Variables ¶
var Categories = []Category{ GameAssets, Books, Comics, Tools, Games, PhysicalGames, Soundtracks, GameMods, Misc, }
Array containing all categories.
Functions ¶
func ConvertContentToItems ¶
ConvertContentToItems converts a Content to a channel full of Item. Only the Items at -100% sales will be kept. It also does the needed API calls to get the end date for each Item. It may return an error if any arises.
func GetBooksContent ¶
GetBooksContent puts in a list the `books` type content for a given page. It returns whether it was the last page and an error if any.
func GetCategoryItemsAsJSON ¶
GetCategoryItemsAsJSON returns a JSON string containing all items for a given category.
func GetComicsContent ¶
GetComicsContent puts in a list the `comics` type content for a given page. It returns whether it was the last page and an error if any.
func GetGameAssetsContent ¶
GetGameAssetsContent puts in a list the `game-assets` type content for a given page. It returns whether it was the last page and an error if any.
func GetGameModsContent ¶
GetGameModsContent puts in a list the `game-mods` type content for a given page. It returns whether it was the last page and an error if any.
func GetGamesContent ¶
GetGamesContent puts in a list the `games` type content for a given page. It returns whether it was the last page and an error if any.
func GetMiscContent ¶
GetMiscContent puts in a list the `misc` type content for a given page. It returns whether it was the last page and an error if any.
func GetPhysicalGamesContent ¶
GetPhysicalGamesContent puts in a list the `physical-games` type content for a given page. It returns whether it was the last page and an error if any.
func GetSoundtracksContent ¶
GetSoundstracksContent puts in a list the `soundtracks` type content for a given page. It returns whether it was the last page and an error if any.
Types ¶
type Content ¶
type Content struct { Page int `json:"page"` NumItems int `json:"num_items"` Content string `json:"content"` }
API calls to itch.io return a JSON object. The Content struct is based on that JSON object.
type GetCategoryContentFn ¶
Type that represents a function to get a Content for a specific category.
type Item ¶
type Item struct { ID string `json:"id"` Link string `json:"link"` ImgLink string `json:"img_link"` Title string `json:"title"` Description string `json:"description"` Author string `json:"author"` SalesLink string `json:"sales_link"` EndDate string `json:"end_date"` Genre string `json:"genre"` Platforms []string `json:"platforms"` }
The Item struct represents the data for an itch.io item.
func GetCategoryItems ¶
GetCategoryItems returns a list containing all items for a given category.