mtgjson

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadAllPrintings

func DownloadAllPrintings(w io.Writer) error

func ReadCardsGOB added in v0.2.0

func ReadCardsGOB(dir string, cb func(Card)) error

func WriteAllPrintingsGOB

func WriteAllPrintingsGOB(w io.Writer, p AllPrintings) error

func WriteCardGOB added in v0.2.0

func WriteCardGOB(dir string, card Card) error

func WriteCardsGOB added in v0.2.0

func WriteCardsGOB(dir string, cards []Card) error

Types

type AllPrintings

type AllPrintings map[SetID]Data

func ReadAllPrintingsGOB

func ReadAllPrintingsGOB(r io.Reader) (AllPrintings, error)

func ReadAllPrintingsJSON

func ReadAllPrintingsJSON(r io.Reader) (AllPrintings, error)

func (AllPrintings) Cards

func (p AllPrintings) Cards() []Card

func (AllPrintings) FilterOnlineOnly

func (p AllPrintings) FilterOnlineOnly(o bool) AllPrintings

func (AllPrintings) SetIDs

func (p AllPrintings) SetIDs() []SetID

type Availability

type Availability []string

func (Availability) Paper

func (a Availability) Paper() bool

type BorderColor

type BorderColor string

type Card

type Card struct {
	UUID                    UUID             `json:"uuid"`
	Identifiers             ID               `json:"identifiers"`
	Name                    string           `json:"name"`
	SetCode                 SetID            `json:"setCode"`
	Availability            Availability     `json:"availability"`
	Artist                  string           `json:"artist"`
	ASCII                   string           `json:"asciiName"`
	BorderColor             BorderColor      `json:"borderColor"`
	ColorIdentity           Colors           `json:"colorIdentity"`
	ColorIndicator          Colors           `json:"colorIndicator"`
	Colors                  Colors           `json:"colors"`
	ConvertedManaCost       float64          `json:"convertedManaCost"`
	FaceConvertedManaCost   float64          `json:"faceConvertedManaCost"`
	FaceName                string           `json:"faceName"`
	FlavorName              string           `json:"flavorName"`
	FlavorText              string           `json:"flavorText"`
	FrameEffects            []FrameEffect    `json:"frameEffects"`
	FrameVersion            string           `json:"frameVersion"`
	Hand                    string           `json:"hand"`
	HasContentWarning       bool             `json:"hasContentWarning"`
	HasFoil                 bool             `json:"hasFoil"`
	HasAlternativeDeckLimit bool             `json:"hasAlternativeDeckLimit"`
	HasNonFoil              bool             `json:"hasNonFoil"`
	IsAlternative           bool             `json:"isAlternative"`
	IsFullArt               bool             `json:"isFullArt"`
	IsOnlineOnly            bool             `json:"isOnlineOnly"`
	IsOversized             bool             `json:"isOversized"`
	IsPromo                 bool             `json:"isPromo"`
	IsReprint               bool             `json:"isReprint"`
	IsReserved              bool             `json:"isReserved"`
	IsStarter               bool             `json:"isStarter"`
	IsStorySpotlight        bool             `json:"isStorySpotlight"`
	IsTextless              bool             `json:"isTextless"`
	IsTimeshifted           bool             `json:"isTimeshifted"`
	Keywords                Keywords         `json:"keywords"`
	Layout                  Layout           `json:"layout"`
	Life                    string           `json:"life"`
	Loyalty                 string           `json:"loyalty"`
	ManaCost                string           `json:"manaCost"`
	Number                  string           `json:"number"`
	OriginalReleaseDate     Time             `json:"originalReleaseDate"`
	OriginalText            string           `json:"originalText"`
	OriginalType            string           `json:"originalType"`
	OtherFaceIds            []UUID           `json:"otherFaceIds"`
	Power                   string           `json:"power"`
	Printings               []SetID          `json:"printings"`
	PromoTypes              []string         `json:"promoTypes"`
	Rarity                  Rarity           `json:"rarity"`
	Side                    string           `json:"side"`
	Subtypes                []string         `json:"subtypes"`
	Supertypes              []string         `json:"supertypes"`
	Text                    string           `json:"text"`
	Toughness               string           `json:"toughness"`
	Type                    string           `json:"type"`
	Types                   []string         `json:"types"`
	Variations              []UUID           `json:"variations"`
	Watermark               string           `json:"watermark"`
	PurchaseURLs            PurchaseURLs     `json:"purchaseUrls"`
	LeadershipSkills        LeadershipSkills `json:"leadershipSkills"`
	Legalities              Legalities       `json:"legalities"`
	Rulings                 []Ruling         `json:"rulings"`
	EDHRECRank              int              `json:"edhrecRank"`
	ForeignData             []ForeignData    `json:"foreignData"`
}

func ReadCardGOB added in v0.2.0

func ReadCardGOB(dir string, uuid UUID) (Card, error)

type Color

type Color string

type Colors

type Colors []Color

type Data

type Data struct {
	Type             string `json:"type"`
	ReleaseDate      Time   `json:"releaseDate"`
	Code             string `json:"code"`
	Name             string `json:"name"`
	KeyruneCode      string `json:"keyruneCode"`
	Block            string `json:"block"`
	TCGPlayerGroupId int64  `json:"tcgPlayerGroupId"`
	MCMID            int    `json:"mcmid"`
	MCMName          string `json:"mcmName"`
	TotalSetSize     int    `json:"totalSetSize"`
	BaseSetSize      int    `json:"baseSetSize"`
	IsNonFoilOnly    bool   `json:"isNonFoilOnly"`
	IsFoilOnly       bool   `json:"isFoilOnly"`
	IsOnlineOnly     bool   `json:"isOnlineOnly"`

	Cards []Card `json:"cards"`
}

type ForeignData added in v0.1.5

type ForeignData struct {
	FaceName     string `json:"faceName"`
	FlavorText   string `json:"flavorText"`
	Language     string `json:"language"`
	MultiverseID int    `json:"multiverseId"`
	Name         string `json:"name"`
	Text         string `json:"text"`
	Type         string `json:"type"`
}

type FrameEffect

type FrameEffect string

type ID

type ID struct {
	CardKingdomFoilId      string `json:"cardKingdomFoilId"`
	CardKingdomId          string `json:"cardKingdomId"`
	McmId                  string `json:"mcmId"`
	McmMetaId              string `json:"mcmMetaId"`
	MtgArenaId             string `json:"mtgArenaId"`
	MtgoFoilId             string `json:"mtgoFoilId"`
	MtgoId                 string `json:"mtgoId"`
	MtgjsonV4Id            string `json:"mtgjsonV4Id"`
	MultiverseId           string `json:"multiverseId"`
	ScryfallId             string `json:"scryfallId"`
	ScryfallOracleId       string `json:"scryfallOracleId"`
	ScryfallIllustrationId string `json:"scryfallIllustrationId"`
	TcgplayerProductId     string `json:"tcgplayerProductId"`
}

type Keywords

type Keywords []string

func (Keywords) String added in v0.2.0

func (k Keywords) String() string

type Layout

type Layout string

type LeadershipSkills added in v0.1.5

type LeadershipSkills struct {
	Brawl       bool `json:"brawl"`
	Commander   bool `json:"commander"`
	Oathbreaker bool `json:"oathbreaker"`
}

type Legalities added in v0.1.5

type Legalities struct {
	Brawl     string `json:"brawl"`
	Commander string `json:"commander"`
	Duel      string `json:"duel"`
	Future    string `json:"future"`
	Frontier  string `json:"frontier"`
	Historic  string `json:"historic"`
	Legacy    string `json:"legacy"`
	Modern    string `json:"modern"`
	Pauper    string `json:"pauper"`
	Penny     string `json:"penny"`
	Pioneer   string `json:"pioneer"`
	Standard  string `json:"standard"`
	Vintage   string `json:"vintage"`
}

type PurchaseURLs added in v0.1.5

type PurchaseURLs struct {
	CardKingdom     string `json:"cardKingdom"`
	CardKingdomFoil string `json:"cardKingdomFoil"`
	Cardmarket      string `json:"cardmarket"`
	TCGPlayer       string `json:"tcgplayer"`
}

type Rarity

type Rarity string

type Ruling added in v0.1.5

type Ruling struct {
	Date Time   `json:"date"`
	Text string `json:"text"`
}

type SetID

type SetID string

type Time

type Time string

type UUID

type UUID string

Jump to

Keyboard shortcuts

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