types

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: GPL-3.0 Imports: 2 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeArtist

func EncodeArtist(artist Artist) ([]byte, error)

func EncodeArtistInfo

func EncodeArtistInfo(artists ArtistInfo) ([]byte, error)

func EncodeInfoRetrieval

func EncodeInfoRetrieval(info InfoRetrieval) ([]byte, error)

func EncodeJob

func EncodeJob(job Job) ([]byte, error)

Types

type Artist

type Artist struct {
	Name    string
	URL     string
	ID      string
	Genre   string
	Country string
	Records []Record
}

func DecodeArtist

func DecodeArtist(encoded []byte) (Artist, error)

type ArtistInfo

type ArtistInfo struct {
	Data      Artist
	ExtraData []Artist
}

func DecodeArtistInfo

func DecodeArtistInfo(encoded []byte) (ArtistInfo, error)

type InfoRetrieval

type InfoRetrieval struct {
	Type   InfoRetrievalType
	Data   []byte
	Artist string
	Album  string
}

func DecodeInfoRetrieval

func DecodeInfoRetrieval(encoded []byte) (InfoRetrieval, error)

type InfoRetrievalType

type InfoRetrievalType int
const (
	ArtistName InfoRetrievalType = 1 << iota
	ArtistData
	AlbumName
	AlbumData
	AlbumWithArtistData
)

type Job

type Job struct {
	ID             string  `json:"id"`
	Finished       bool    `json:"finished"`
	Status         bool    `json:"status"`
	Type           JobType `json:"type"`
	LastOrigin     string  `json:"lastorigin"`
	RequiredOrigin string  `json:"requiredorigin"`
	Data           []byte  `json:"data"`
	Result         []byte  `json:"result"`
	Error          string  `json:"error"`
}

func DecodeJob

func DecodeJob(encoded []byte) (Job, error)

type JobType

type JobType int
const (
	ArtistInfoRetrieval JobType = 1 << iota
	RecordInfoRetrieval
	JobInfoRetrieval
	Die
)

type Record

type Record struct {
	Name   string
	ID     string
	Year   int
	URL    string
	Type   RecordType
	Tracks []Track
}

type RecordType

type RecordType int
const (
	FullLength RecordType = 1 << iota
	Demo
	EP
	Compilation
	Live
	BoxedSet
	Single
	Video
	Split
	Other
)

type Track

type Track struct {
	Name    string
	Hours   int
	Minutes int
	Seconds int
}

Jump to

Keyboard shortcuts

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