mtgprice

package
v0.0.0-...-5b841e8 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2016 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardInfo

type CardInfo struct {
	Name  string   `json:"name"`
	Names []string `json:"names,omitempty"`
	// NOTE: there is one card with .5 mana cost.
	CMC          float64    `json:"cmc"`
	MultiverseID *int       `json:"multiverseid,omitempty"`
	ManaCost     string     `json:"manaCost"`
	Rarity       string     `json:"rarity"`
	Power        string     `json:"power,omitempty"`
	Toughness    string     `json:"toughness,omitempty"`
	Type         string     `json:"type"`
	Types        []string   `json:"types"`
	Colors       []string   `json:"colors"`
	Text         string     `json:"text"`
	Legalities   []Legality `json:"legalities"`
}

func (*CardInfo) Detail

func (c *CardInfo) Detail() string

func (*CardInfo) String

func (c *CardInfo) String() string

type Client

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

func Open

func Open(opts Opts) (c *Client, err error)

func (*Client) CardInfo

func (c *Client) CardInfo(cardName string) (ci CardInfo, ok bool)

func (*Client) Close

func (c *Client) Close() error

func (*Client) PriceForCard

func (c *Client) PriceForCard(cardName string) (prices tcg.Price, err error)

func (*Client) Query

func (c *Client) Query(q string) ([]*CardInfo, error)

func (*Client) RichInfo

func (c *Client) RichInfo(cardName string) (i info, err error)

type Legality

type Legality struct {
	Format   string `json:"format"`
	Legality string `json:"legality"`
}

type Opts

type Opts struct {
	Filename, CardData string
}

type Query

type Query struct {
	Name, Rule, Type []string
	ExactName        string

	// Color may be "w", "u", "b", "r", "g", "m" (multicolored),
	// or any of the previous characters with a "!" prefix (not).
	Color []string
}

func ParseQuery

func ParseQuery(s string) *Query

func (*Query) Match

func (q *Query) Match(c *CardInfo) bool

Jump to

Keyboard shortcuts

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