jerkcity

package
v0.0.0-...-a2b456a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoEpisodes = errors.New("jerkcity: the api returned no episodes")

ErrNoEpisodes is returned when the Jerkcity API does not return a comic.

Functions

This section is empty.

Types

type APIEpisode

type APIEpisode struct {
	Episodes []*Episode `json:"episodes"`
}

APIEpisode is a partial, common response from the Jerkcity API.

type APIQuotedEpisode

type APIQuotedEpisode struct {
	Episodes []*QuotedEpisode `json:"episodes"`
}

APIQuotedEpisode is a partial response from the quote/random endpoint.

type Episode

type Episode struct {
	Episode int    `json:"episode"`
	Thumb   string `json:"thumb"`
	Image   string `json:"image"`
	Title   string `json:"title"`
	Height  int    `json:"height"`
	Width   int    `json:"width"`
	Day     int    `json:"day"`
	Month   int    `json:"month"`
	Year    int    `json:"year"`

	Dialog  [][]string `json:"dialog"`
	Tags    []string
	Players []string
}

Episode is a Jerkcity comic as defined by the API.

func GetEpisode

func GetEpisode(ctx context.Context, episode int) (*Episode, error)

GetEpisode returns an Episode by its number.

func GetRandom

func GetRandom(ctx context.Context) (*Episode, error)

GetRandom returns a single, random comic from Jerkcity's API.

type QuotedEpisode

type QuotedEpisode struct {
	Episode
	Quote string `json:"quote"`
	User  string `json:"user"`
}

QuotedEpisode is a Jerkcity comic including a quote from the aforementioned.

func GetQuote

func GetQuote(ctx context.Context) (*QuotedEpisode, error)

GetQuote returns a quoted episode from Jerkcity.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL