releases

package
v1.11.13 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package releases handles collections of Demozoo Productions that share a common filter such as a platform or category type.

Index

Constants

This section is empty.

Variables

View Source
var ErrNegativeID = errors.New("demozoo production id cannot be a negative integer")

Functions

func Site

func Site(title string) string

Site parses a production title to see if it is suitable as a BBS or FTP site name, otherwise an empty string is returned.

func Tags

func Tags(platforms, types, title string) (string, string)

Tags returns the platform and section.

func URLReleasers added in v1.7.0

func URLReleasers(id int64) (string, error)

URL generates an API v1 URL used to fetch the productions of a releaser ID. i.e. https://demozoo.org/api/v1/releasers/1/productions/

Types

type Filter added in v1.7.0

type Filter uint

Filter the Production List using API fields.

const (
	MsDos   Filter = iota // MsDos filters by platforms id 4.
	Windows               // Windows filters by platforms id 1.
)

func (Filter) String added in v1.7.0

func (f Filter) String() string

func (Filter) URL added in v1.7.0

func (f Filter) URL(startPage int) (string, error)

URL generates an API v1 URL used to fetch the productions filtered by a productions id. i.e. https://demozoo.org/api/v1/productions/?supertype=production&title=&platform=4

func (Filter) URLString added in v1.7.1

func (f Filter) URLString(startPage int) string

type ProductionV1

type ProductionV1 struct {
	ExistsInDB bool
	// 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 []interface{} `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 []Type `json:"types"`
	// Types []struct {
	// 	URL  string `json:"url"`
	// 	ID   int    `json:"id"`
	// 	Name string `json:"name"`
	// } `json:"types"`
	Tags []string `json:"tags"`
}

Productions releasers 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/releasers/{{.ID}}/productions?format=json

func (ProductionV1) Groups

func (p ProductionV1) Groups() (string, string)

Groups returns the first two names in the production that have is_group as true. The one exception is if the production title contains a reference to a BBS or FTP site name. Then that title will be used as the first group returned.

func (ProductionV1) Released

func (p ProductionV1) Released() (
	year int, month int, day int,
)

Released returns the production's release date as date_issued_ year, month, day values.

type Productions

type Productions []ProductionV1

func (*Productions) Print

func (p *Productions) Print(w io.Writer) error

Print to stdout the production API results as tabbed JSON.

type Type added in v1.7.0

type Type struct {
	URL  string `json:"url"`
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Type of production.

Jump to

Keyboard shortcuts

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