releaser

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func URL

func URL(id int64) (string, error)

URL creates a releaser URL from a Demozoo ID.

Types

type Releaser

type Releaser struct {
	ID         int64         // Demozoo releaser ID
	Timeout    time.Duration // HTTP request timeout in seconds (default 5)
	Link       string        // URL link to send the request
	StatusCode int           // received HTTP statuscode
	Status     string        // received HTTP status
}

Releaser API production request.

func (*Releaser) Get

func (r *Releaser) Get() (ReleaserV1, error)

Get a releaser API link and normalises the results.

func (*Releaser) Prods

func (r *Releaser) Prods() (releases.Productions, error)

Prods gets all the productions of a releaser and normalises the results.

func (*Releaser) URL

func (r *Releaser) URL() error

URL creates a releasers API v1 request link. example: https://demozoo.org/api/v1/releasers/10000/?format=json

type ReleaserV1

type ReleaserV1 struct {
	URL        string `json:"url"`
	DemozooURL string `json:"demozoo_url"`
	ID         int    `json:"id"`
	Name       string `json:"name"`
	IsGroup    bool   `json:"is_group"`
	Nicks      []struct {
		Name          string   `json:"name"`
		Abbreviation  string   `json:"abbreviation"`
		IsPrimaryNick bool     `json:"is_primary_nick"`
		Variants      []string `json:"variants"`
	} `json:"nicks"`
	MemberOf []interface{} `json:"member_of"`
	Members  []struct {
		Member struct {
			URL  string `json:"url"`
			ID   int    `json:"id"`
			Name string `json:"name"`
		} `json:"member"`
		IsCurrent bool `json:"is_current"`
	} `json:"members"`
	Subgroups     []interface{} `json:"subgroups"`
	ExternalLinks []struct {
		LinkClass string `json:"link_class"`
		URL       string `json:"url"`
	} `json:"external_links"`
}

ReleaserV1 releasers 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}}/?format=json

func (*ReleaserV1) Print

func (r *ReleaserV1) Print() error

Print to stdout the releaser API results as tabbed JSON.

Jump to

Keyboard shortcuts

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