releaser

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: 10 Imported by: 0

Documentation

Overview

Package releaser handles Demozoo Releasers which are objects for both scene groups and people.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrID   = errors.New("demozoo id cannot be a negative integer")
	ErrNoID = errors.New("a demozoo releaser id is required")
)

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
	Code    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(w io.Writer) 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