Documentation ¶
Index ¶
- func Attr(n *html.Node, key string) string
- func CreateCollection(db *cql.DB, r brew.Reader, collection MTGCollection) error
- func DownloadCards(url, path string) error
- func Find(n *html.Node, selector string) (*html.Node, bool)
- func FindAll(n *html.Node, selector string) []*html.Node
- func Flatten(n *html.Node) string
- func Headers(next goji.Handler) goji.Handler
- func JSON(w http.ResponseWriter, code int, val interface{})
- func LinkHeader(host string, u *url.URL, page int) string
- func MigrateDatabase() error
- func New(cfg *config.Config, client brew.Reader) http.Handler
- func NotFound(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func ParseSearch(u *url.URL) (brew.Search, error, []string)
- func Recover(next goji.Handler) goji.Handler
- func Slug(name string) string
- func SplitTrimSpace(source, pattern string) []string
- func SyncCards() error
- func ToSortedLower(things []string) []string
- func Tracing(next goji.Handler) goji.Handler
- func TransformCard(c MTGCard) brew.Card
- func TransformCollection(collection MTGCollection) ([]brew.Set, []brew.Card)
- func TransformEdition(s MTGSet, c MTGCard) brew.Edition
- func TransformLegalities(lgs []MTGLegality) map[string]string
- func TransformSet(s MTGSet) brew.Set
- type API
- func (a *API) HandleCard(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func (a *API) HandleCards(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func (a *API) HandleRandomCard(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func (a *API) HandleSet(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func (a *API) HandleSets(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func (a *API) HandleTerm(f func(context.Context) ([]string, error)) func(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func (a *API) HandleTypeahead(ctx context.Context, w http.ResponseWriter, r *http.Request)
- type ApiError
- type MTGCard
- type MTGCollection
- type MTGLegality
- type MTGRuling
- type MTGSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCollection ¶
func DownloadCards ¶
I probably should have just kept the Makefile
func JSON ¶
func JSON(w http.ResponseWriter, code int, val interface{})
func MigrateDatabase ¶
func MigrateDatabase() error
func SplitTrimSpace ¶
func ToSortedLower ¶
func TransformCard ¶
func TransformCollection ¶
func TransformCollection(collection MTGCollection) ([]brew.Set, []brew.Card)
func TransformLegalities ¶
func TransformLegalities(lgs []MTGLegality) map[string]string
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) HandleCard ¶
func (*API) HandleCards ¶
func (*API) HandleRandomCard ¶
func (*API) HandleSets ¶
func (*API) HandleTerm ¶
func (*API) HandleTypeahead ¶
type MTGCard ¶
type MTGCard struct { Artist string `json:"artist"` Border string `json:"border"` Colors []string `json:"colors"` ConvertedCost float64 `json:"cmc"` Flavor string `json:"flavor"` HandModifier int `json:"hand"` Layout string `json:"layout"` LifeModifier int `json:"life"` Loyalty int `json:"loyalty"` Legalities []MTGLegality `json:"legalities"` ManaCost string `json:"manaCost"` MultiverseId int `json:"multiverseid"` Name string `json:"name"` Names []string `json:"names"` Number string `json:"number"` Power string `json:"power"` Rarity string `json:"rarity"` Rulings []MTGRuling `json:"rulings"` Subtypes []string `json:"subtypes"` Supertypes []string `json:"supertypes"` Text string `json:"text"` Toughness string `json:"toughness"` Type string `json:"type"` Types []string `json:"types"` Watermark string `json:"watermark"` }
type MTGCollection ¶
func LoadCollection ¶
func LoadCollection(path string) (MTGCollection, error)
type MTGLegality ¶
Click to show internal directories.
Click to hide internal directories.