cards

package
v0.0.0-...-0c8f6a9 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UniqueCards  = "cards"
	UniqueArt    = "art"
	UniquePrints = "prints"
)
View Source
const (
	Standard        = "standard"
	Future          = "future"
	Historic        = "historic"
	Gladiator       = "gladiator"
	Pioneer         = "pioneer"
	Explorer        = "explorer"
	Modern          = "modern"
	Legacy          = "legacy"
	Pauper          = "pauper"
	Vintage         = "vintage"
	Penny           = "penny"
	Commander       = "commander"
	Brawl           = "brawl"
	HistoricBrawl   = "historicbrawl"
	Alchemy         = "alchemy"
	PauperCommander = "paupercommander"
	Duel            = "duel"
	Oldschool       = "oldschool"
	Premodern       = "premodern"
)

Variables

View Source
var LegalitiesKeysMap = map[string]string{
	Standard:        "Standard",
	Future:          "Future",
	Historic:        "Historic",
	Gladiator:       "Gladiator",
	Pioneer:         "Pioneer",
	Explorer:        "Explorer",
	Modern:          "Modern",
	Legacy:          "Legacy",
	Pauper:          "Pauper",
	Vintage:         "Vintage",
	Penny:           "Penny",
	Commander:       "Commander",
	Brawl:           "Brawl",
	HistoricBrawl:   "Historic Brawl",
	Alchemy:         "Alchemy",
	PauperCommander: "Pauper Commander",
	Duel:            "Duel",
	Oldschool:       "Oldschool",
	Premodern:       "Premodern",
}
View Source
var LegalitiesNameMap = map[string]string{
	"Standard":         Standard,
	"Future":           Future,
	"Historic":         Historic,
	"Gladiator":        Gladiator,
	"Pioneer":          Pioneer,
	"Explorer":         Explorer,
	"Modern":           Modern,
	"Legacy":           Legacy,
	"Pauper":           Pauper,
	"Vintage":          Vintage,
	"Penny":            Penny,
	"Commander":        Commander,
	"Brawl":            Brawl,
	"Historic Brawl":   HistoricBrawl,
	"Alchemy":          Alchemy,
	"Pauper Commander": PauperCommander,
	"Duel":             Duel,
	"Oldschool":        Oldschool,
	"Premodern":        Premodern,
}

Functions

This section is empty.

Types

type AllParts

type AllParts struct {
	Object    string `json:"object"`
	Id        string `json:"id"`
	Component string `json:"component"`
	Name      string `json:"name"`
	TypeLine  string `json:"type_line"`
	Uri       string `json:"uri"`
}

type Card

type Card struct {
	Object          string              `json:"object"`
	Id              string              `json:"id"`
	OracleId        string              `json:"oracle_id"`
	MultiverseIds   []int               `json:"multiverse_ids"`
	MtgoId          int                 `json:"mtgo_id"`
	TcgplayerId     int                 `json:"tcgplayer_id"`
	CardmarketId    int                 `json:"cardmarket_id"`
	Name            string              `json:"name"`
	Lang            string              `json:"lang"`
	ReleasedAt      string              `json:"released_at"`
	Uri             string              `json:"uri"`
	ScryfallUri     string              `json:"scryfall_uri"`
	Layout          string              `json:"layout"`
	HighresImage    bool                `json:"highres_image"`
	ImageStatus     string              `json:"image_status"`
	ImageUris       ImageUris           `json:"image_uris"`
	ManaCost        string              `json:"mana_cost"`
	Cmc             float64             `json:"cmc"`
	TypeLine        string              `json:"type_line"`
	FlavorText      string              `json:"flavor_text"`
	OracleText      string              `json:"oracle_text"`
	Power           string              `json:"power"`
	Toughness       string              `json:"toughness"`
	Colors          []string            `json:"colors"`
	ColorIndicator  []string            `json:"color_indicator"`
	ColorIdentity   []string            `json:"color_identity"`
	Keywords        []interface{}       `json:"keywords"`
	ProducedMana    []string            `json:"produced_mana"`
	CardFaces       []CardFace          `json:"card_faces"`
	AllParts        []AllParts          `json:"all_parts"`
	Legalities      map[string]Legality `json:"legalities"`
	Games           []string            `json:"games"`
	Reserved        bool                `json:"reserved"`
	Foil            bool                `json:"foil"`
	Nonfoil         bool                `json:"nonfoil"`
	Finishes        []string            `json:"finishes"`
	Oversized       bool                `json:"oversized"`
	Promo           bool                `json:"promo"`
	Reprint         bool                `json:"reprint"`
	Variation       bool                `json:"variation"`
	SetId           string              `json:"set_id"`
	Set             string              `json:"set"`
	SetName         string              `json:"set_name"`
	SetType         string              `json:"set_type"`
	SetUri          string              `json:"set_uri"`
	SetSearchUri    string              `json:"set_search_uri"`
	ScryfallSetUri  string              `json:"scryfall_set_uri"`
	RulingsUri      string              `json:"rulings_uri"`
	PrintsSearchUri string              `json:"prints_search_uri"`
	CollectorNumber string              `json:"collector_number"`
	Digital         bool                `json:"digital"`
	Rarity          string              `json:"rarity"`
	CardBackId      string              `json:"card_back_id"`
	Artist          string              `json:"artist"`
	ArtistIds       []string            `json:"artist_ids"`
	IllustrationId  string              `json:"illustration_id"`
	BorderColor     string              `json:"border_color"`
	Frame           string              `json:"frame"`
	FrameEffects    []string            `json:"frame_effects"`
	SecurityStamp   string              `json:"security_stamp"`
	FullArt         bool                `json:"full_art"`
	Textless        bool                `json:"textless"`
	Booster         bool                `json:"booster"`
	StorySpotlight  bool                `json:"story_spotlight"`
	EdhrecRank      int                 `json:"edhrec_rank"`
	Preview         Preview             `json:"preview"`
	Prices          Prices              `json:"prices"`
	RelatedUris     RelatedUris         `json:"related_uris"`
	PurchaseUris    PurchaseUris        `json:"purchase_uris"`
}

func (Card) IsArtifact

func (c Card) IsArtifact() bool

func (Card) IsBasicLand

func (c Card) IsBasicLand() bool

func (Card) IsCreature

func (c Card) IsCreature() bool

func (Card) IsEnchantment

func (c Card) IsEnchantment() bool

func (Card) IsInstant

func (c Card) IsInstant() bool

func (Card) IsLand

func (c Card) IsLand() bool

func (Card) IsLegendaryCreature

func (c Card) IsLegendaryCreature() bool

func (Card) IsLegendaryPlaneswalker

func (c Card) IsLegendaryPlaneswalker() bool

func (Card) IsSorcery

func (c Card) IsSorcery() bool

func (Card) ParseManaCost

func (c Card) ParseManaCost() [][]string

type CardFace

type CardFace struct {
	Object         string    `json:"object"`
	Name           string    `json:"name"`
	FlavorName     string    `json:"flavor_name"`
	ManaCost       string    `json:"mana_cost"`
	TypeLine       string    `json:"type_line"`
	OracleText     string    `json:"oracle_text"`
	Colors         []string  `json:"colors"`
	ColorIndicator []string  `json:"color_indicator"`
	Loyalty        string    `json:"loyalty"`
	Artist         string    `json:"artist"`
	ArtistId       string    `json:"artist_id"`
	IllustrationId string    `json:"illustration_id"`
	ImageUris      ImageUris `json:"image_uris"`
	Power          string    `json:"power"`
	Toughness      string    `json:"toughness"`
}

type CardRepo

type CardRepo interface {
	ListCards(setID, uniqueness, next string) (*endpoint.Response[[]Card], error)
}

func NewRestCardRepo

func NewRestCardRepo(endpoint *endpoint.Endpoint) CardRepo

type ImageUris

type ImageUris struct {
	Small      string `json:"small"`
	Normal     string `json:"normal"`
	Large      string `json:"large"`
	Png        string `json:"png"`
	ArtCrop    string `json:"art_crop"`
	BorderCrop string `json:"border_crop"`
}

type Legality

type Legality int
const (
	Legal Legality = iota
	NotLegal
	Restricted
	Banned
	Unknown
)

func LegalityFromString

func LegalityFromString(l string) Legality

func (Legality) Display

func (l Legality) Display() string

func (*Legality) MarshalJSON

func (l *Legality) MarshalJSON() ([]byte, error)

func (Legality) String

func (l Legality) String() string

func (*Legality) UnmarshalJSON

func (l *Legality) UnmarshalJSON(bs []byte) error

type Preview

type Preview struct {
	Source      string `json:"source"`
	SourceUri   string `json:"source_uri"`
	PreviewedAt string `json:"previewed_at"`
}

type Prices

type Prices struct {
	Usd       string      `json:"usd"`
	UsdFoil   string      `json:"usd_foil"`
	UsdEtched interface{} `json:"usd_etched"`
	Eur       string      `json:"eur"`
	EurFoil   string      `json:"eur_foil"`
	Tix       string      `json:"tix"`
}

type PurchaseUris

type PurchaseUris struct {
	Tcgplayer   string `json:"tcgplayer"`
	Cardmarket  string `json:"cardmarket"`
	Cardhoarder string `json:"cardhoarder"`
}

type RelatedUris

type RelatedUris struct {
	Gatherer                  string `json:"gatherer"`
	TcgplayerInfiniteArticles string `json:"tcgplayer_infinite_articles"`
	TcgplayerInfiniteDecks    string `json:"tcgplayer_infinite_decks"`
	Edhrec                    string `json:"edhrec"`
}

type RestCardRepo

type RestCardRepo struct {
	// contains filtered or unexported fields
}

func (RestCardRepo) ListCards

func (r RestCardRepo) ListCards(setID, uniqueness, next string) (*endpoint.Response[[]Card], error)

Jump to

Keyboard shortcuts

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