brew

package
v0.0.0-...-c558d60 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeName

func NormalizeName(name string) string

func ReplaceUnicode

func ReplaceUnicode(name string) string

func TCGCardURL

func TCGCardURL(c *Card) string

func TCGEditionURL

func TCGEditionURL(c *Card, e *Edition) string

func TCGName

func TCGName(name string, id int) string

func TCGSet

func TCGSet(setId, set string) string

func TCGSlug

func TCGSlug(name string) string

func TranslateID

func TranslateID(id int) string

Types

type Card

type Card struct {
	Name          string            `json:"name"`
	Id            string            `json:"id"`
	Href          string            `json:"url,omitempty"`
	StoreUrl      string            `json:"store_url"`
	Types         []string          `json:"types,omitempty"`
	Supertypes    []string          `json:"supertypes,omitempty"`
	Subtypes      []string          `json:"subtypes,omitempty"`
	Colors        []string          `json:"colors,omitempty"`
	ConvertedCost int               `json:"cmc"`
	ManaCost      string            `json:"cost"`
	Text          string            `json:"text"`
	Power         string            `json:"power,omitempty"`
	Toughness     string            `json:"toughness,omitempty"`
	Loyalty       int               `json:"loyalty,omitempty"`
	FormatMap     map[string]string `json:"formats"`
	Editions      []Edition         `json:"editions,omitempty"`
}

func (*Card) Fill

func (c *Card) Fill(r router)

Don't expose this

func (*Card) Formats

func (c *Card) Formats() []string

func (*Card) Multicolor

func (c *Card) Multicolor() bool

func (*Card) MultiverseIds

func (c *Card) MultiverseIds() []string

func (*Card) Rarities

func (c *Card) Rarities() []string

func (*Card) Sets

func (c *Card) Sets() []string

func (*Card) Status

func (c *Card) Status() []string

type Edition

type Edition struct {
	Set          string `json:"set"`
	SetId        string `json:"set_id"`
	CardId       string `json:"-"`
	Watermark    string `json:"watermark,omitempty"`
	Rarity       string `json:"rarity"`
	Border       string `json:"-"`
	Artist       string `json:"artist"`
	MultiverseId int    `json:"multiverse_id"`
	Flavor       string `json:"flavor,omitempty"`
	Number       string `json:"number"`
	Layout       string `json:"layout"`
	Price        *Price `json:"price,omitempty"`
	Href         string `json:"url,omitempty"`
	ImageUrl     string `json:"image_url,omitempty"`
	SetUrl       string `json:"set_url,omitempty"`
	StoreUrl     string `json:"store_url"`
	HTMLUrl      string `json:"html_url"`
}

type Price

type Price struct {
	Low     int `json:"low"`
	Average int `json:"median"`
	High    int `json:"high"`
}

type Reader

type Reader interface {
	GetCards(context.Context, Search) ([]Card, error)
	GetCardsByName(context.Context, string) ([]Card, error)
	GetCard(context.Context, string) (Card, error)
	GetRandomCardID(context.Context) (string, error)
	GetSets(context.Context) ([]Set, error)
	GetSet(context.Context, string) (Set, error)
	GetColors(context.Context) ([]string, error)
	GetSupertypes(context.Context) ([]string, error)
	GetSubtypes(context.Context) ([]string, error)
	GetTypes(context.Context) ([]string, error)
}

func NewReader

func NewReader(cfg *config.Config) (Reader, error)
type Search struct {
	Colors            []string
	Formats           []string
	IncludeMulticolor bool
	Multicolor        bool
	MultiverseIDs     []string
	Names             []string
	Rarities          []string
	Sets              []string
	Status            []string
	Subtypes          []string
	Supertypes        []string
	Rules             []string
	Types             []string
	Limit             int
	Offset            int
	Page              int
}

type Set

type Set struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	Border     string `json:"border"`
	Type       string `json:"type"`
	Href       string `json:"url"`
	CardsUrl   string `json:"cards_url"`
	PriceGuide string `json:"-"`
	Priced     bool   `json:"-"`
}

func (*Set) Fill

func (s *Set) Fill(r router)

Jump to

Keyboard shortcuts

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