Documentation ¶
Overview ¶
Package prods handles marshalling of a Demozoo Production.
Index ¶
- func Filename(h http.Header) string
- func Mutate(u *url.URL) (*url.URL, error)
- func Parse(rawURL string) (int, error)
- func RandomName() (string, error)
- func SaveName(rawURL string) (string, error)
- type Authors
- type Category
- type DownloadsAPIv1
- type ProductionsAPIv1
- func (p *ProductionsAPIv1) Authors() Authors
- func (p *ProductionsAPIv1) Download(w io.Writer, l DownloadsAPIv1) error
- func (p *ProductionsAPIv1) DownloadLink(w io.Writer) (string, string)
- func (p *ProductionsAPIv1) Downloads(w io.Writer)
- func (p *ProductionsAPIv1) JSON() ([]byte, error)
- func (p *ProductionsAPIv1) PouetID(ping bool) (id int, code int, err error)
- func (p *ProductionsAPIv1) Print(w io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomName ¶
RandomName generates a random temporary filename.
Types ¶
type Authors ¶
type Authors struct { Text []string // credit_text, writer Code []string // credit_program, programmer/coder Art []string // credit_illustration, artist/graphics Audio []string // credit_audio, musician/sound }
Authors contains Defacto2 people rolls.
type DownloadsAPIv1 ¶
DownloadsAPIv1 are DownloadLinks for ProductionsAPIv1.
type ProductionsAPIv1 ¶
type ProductionsAPIv1 struct { URL string `json:"url"` DemozooURL string `json:"demozoo_url"` ID int `json:"id"` Title string `json:"title"` AuthorNicks []struct { Name string `json:"name"` Abbreviation string `json:"abbreviation"` Releaser struct { URL string `json:"url"` ID int `json:"id"` Name string `json:"name"` IsGroup bool `json:"is_group"` } `json:"releaser"` } `json:"author_nicks"` AuthorAffiliationNicks []any `json:"author_affiliation_nicks"` ReleaseDate string `json:"release_date"` Supertype string `json:"supertype"` Platforms []struct { URL string `json:"url"` ID int `json:"id"` Name string `json:"name"` } `json:"platforms"` Types []struct { URL string `json:"url"` ID int `json:"id"` Name string `json:"name"` Supertype string `json:"supertype"` } `json:"types"` Credits []struct { Nick struct { Name string `json:"name"` Abbreviation string `json:"abbreviation"` Releaser struct { URL string `json:"url"` ID int `json:"id"` Name string `json:"name"` IsGroup bool `json:"is_group"` } `json:"releaser"` } `json:"nick"` Category string `json:"category"` Role string `json:"role"` } `json:"credits"` DownloadLinks []struct { LinkClass string `json:"link_class"` URL string `json:"url"` } `json:"download_links"` ExternalLinks []struct { LinkClass string `json:"link_class"` URL string `json:"url"` } `json:"external_links"` ReleaseParties []any `json:"release_parties"` CompetitionPlacings []any `json:"competition_placings"` InvitationParties []any `json:"invitation_parties"` Screenshots []struct { OriginalURL string `json:"original_url"` OriginalWidth int `json:"original_width"` OriginalHeight int `json:"original_height"` StandardURL string `json:"standard_url"` StandardWidth int `json:"standard_width"` StandardHeight int `json:"standard_height"` ThumbnailURL string `json:"thumbnail_url"` ThumbnailWidth int `json:"thumbnail_width"` ThumbnailHeight int `json:"thumbnail_height"` } `json:"screenshots"` }
ProductionsAPIv1 productions API v1. This can be dynamically generated at https://mholt.github.io/json-to-go/ Get the Demozoo JSON output from https://demozoo.org/api/v1/productions/{{.ID}}/?format=json
func (*ProductionsAPIv1) Authors ¶
func (p *ProductionsAPIv1) Authors() Authors
Authors parses Demozoo authors and reclassifies them into Defacto2 people rolls.
func (*ProductionsAPIv1) Download ¶
func (p *ProductionsAPIv1) Download(w io.Writer, l DownloadsAPIv1) error
func (*ProductionsAPIv1) DownloadLink ¶
func (p *ProductionsAPIv1) DownloadLink(w io.Writer) (string, string)
DownloadLink parses the Demozoo DownloadLinks to return the filename and link of the first suitable download.
func (*ProductionsAPIv1) Downloads ¶
func (p *ProductionsAPIv1) Downloads(w io.Writer)
Downloads parses the Demozoo DownloadLinks and saves the first suitable download.
func (*ProductionsAPIv1) JSON ¶
func (p *ProductionsAPIv1) JSON() ([]byte, error)
JSON returns the production API results as tabbed JSON. This is used by internal/generator.go.
func (*ProductionsAPIv1) PouetID ¶
func (p *ProductionsAPIv1) PouetID(ping bool) ( id int, code int, err error, )
PouetID returns the ID value used by Pouet's "which prod" URL query and if ping is enabled, the received HTTP status code. example: https://www.pouet.net/prod.php?which=30352