mtgstocks

package
v0.0.0-...-2cfd05f Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MTGStockPrint

type MTGStockPrint struct {
	ID          int         `json:"id"`
	Slug        interface{} `json:"slug"` // string & int
	Foil        bool        `json:"foil"`
	Image       string      `json:"image"`
	Name        string      `json:"name"`
	Rarity      string      `json:"rarity"`
	LatestPrice struct {
		Avg        float64 `json:"avg"`
		Foil       float64 `json:"foil"`
		Market     float64 `json:"market"`
		MarketFoil float64 `json:"market_foil"`
	} `json:"latest_price"`
	LastWeekPrice float64 `json:"last_week_price,string"`
	PreviousPrice float64 `json:"previous_price,string"`
}

func GetPrints

func GetPrints(id int) ([]MTGStockPrint, error)

type MTGStocks

type MTGStocks struct {
	LogCallback mtgban.LogCallbackFunc

	MaxConcurrency int
	// contains filtered or unexported fields
}

func NewScraper

func NewScraper() *MTGStocks

func (*MTGStocks) Info

func (stks *MTGStocks) Info() (info mtgban.ScraperInfo)

func (*MTGStocks) Inventory

func (stks *MTGStocks) Inventory() (mtgban.InventoryRecord, error)

func (*MTGStocks) InventoryForSeller

func (stks *MTGStocks) InventoryForSeller(sellerName string) (mtgban.InventoryRecord, error)

func (*MTGStocks) MarketNames

func (tcg *MTGStocks) MarketNames() []string

type MTGStocksIndex

type MTGStocksIndex struct {
	LogCallback mtgban.LogCallbackFunc

	MaxConcurrency int
	// contains filtered or unexported fields
}

func NewScraperIndex

func NewScraperIndex() *MTGStocksIndex

func (*MTGStocksIndex) Info

func (stks *MTGStocksIndex) Info() (info mtgban.ScraperInfo)

func (*MTGStocksIndex) Inventory

func (stks *MTGStocksIndex) Inventory() (mtgban.InventoryRecord, error)

func (*MTGStocksIndex) InventoryForSeller

func (stks *MTGStocksIndex) InventoryForSeller(sellerName string) (mtgban.InventoryRecord, error)

func (*MTGStocksIndex) MarketNames

func (tcg *MTGStocksIndex) MarketNames() []string

type MTGStocksInterests

type MTGStocksInterests struct {
	Error     string           `json:"error"`
	Date      string           `json:"date"`
	Interests []StocksInterest `json:"interests"`
}

type MTGStocksSet

type MTGStocksSet struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	Slug         string `json:"slug"`
	Abbreviation string `json:"abbreviation"`
	IconClass    string `json:"icon_class"`
	SetType      string `json:"set_type"`
	Date         int64  `json:"date"`

	Ev     bool            `json:"ev,omitempty"`
	EvDesc string          `json:"ev_desc,omitempty"`
	Prints []MTGStockPrint `json:"prints,omitempty"`
}

func GetSets

func GetSets() ([]MTGStocksSet, error)

type StocksInterest

type StocksInterest struct {
	InterestType string  `json:"interest_type"`
	Foil         bool    `json:"foil"`
	Percentage   float64 `json:"percentage"`
	PastPrice    float64 `json:"past_price"`
	PresentPrice float64 `json:"present_price"`
	Date         int64   `json:"date"`
	Print        struct {
		Id        int         `json:"id"`
		Slug      interface{} `json:"slug"` // string & int
		Name      string      `json:"name"`
		Rarity    string      `json:"rarity"`
		SetId     int         `json:"set_id"`
		SetName   string      `json:"set_name"`
		IconClass string      `json:"icon_class"`
		Reserved  bool        `json:"reserved"`
		SetType   string      `json:"set_type"`
		Legal     struct {
			Frontier  string `json:"frontier"`
			Pauper    string `json:"pauper"`
			Pioneer   string `json:"pioneer"`
			Modern    string `json:"modern"`
			Standard  string `json:"standard"`
			Commander string `json:"commander"`
			Vintage   string `json:"vintage"`
			Legacy    string `json:"legacy"`
		}
		IncludeDefault bool   `json:"include_default"`
		Image          string `json:"image"`
	} `json:"print"`
}

func AverageInterests

func AverageInterests(foil bool) ([]StocksInterest, error)

func MarketInterests

func MarketInterests(foil bool) ([]StocksInterest, error)

Jump to

Keyboard shortcuts

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