cardmarket

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Preprocess

func Preprocess(cardName, variant, edition string) (*mtgmatcher.Card, error)

Types

type CardMarketIndex

type CardMarketIndex struct {
	LogCallback mtgban.LogCallbackFunc

	Affiliate      string
	MaxConcurrency int
	// contains filtered or unexported fields
}

func NewScraperIndex

func NewScraperIndex(appToken, appSecret string) (*CardMarketIndex, error)

func (*CardMarketIndex) Info

func (mkm *CardMarketIndex) Info() (info mtgban.ScraperInfo)

func (*CardMarketIndex) InitializeInventory

func (mkm *CardMarketIndex) InitializeInventory(reader io.Reader) error

func (*CardMarketIndex) Inventory

func (mkm *CardMarketIndex) Inventory() (mtgban.InventoryRecord, error)

func (*CardMarketIndex) InventoryForSeller

func (mkm *CardMarketIndex) InventoryForSeller(sellerName string) (mtgban.InventoryRecord, error)

func (*CardMarketIndex) MarketNames

func (mkm *CardMarketIndex) MarketNames() []string

type CardMarketSealed

type CardMarketSealed struct {
	LogCallback    mtgban.LogCallbackFunc
	MaxConcurrency int
	Affiliate      string
	// contains filtered or unexported fields
}

func NewScraperSealed

func NewScraperSealed(appToken, appSecret string) (*CardMarketSealed, error)

func (*CardMarketSealed) Info

func (mkm *CardMarketSealed) Info() (info mtgban.ScraperInfo)

func (*CardMarketSealed) Inventory

func (mkm *CardMarketSealed) Inventory() (mtgban.InventoryRecord, error)

type MKMArticle

type MKMArticle struct {
	IdArticle int `json:"idArticle"`
	IdProduct int `json:"idProduct"`
	Language  struct {
		IdLanguage   int    `json:"idLanguage"`
		LanguageName string `json:"languageName"`
	} `json:"language"`
	Comments       string  `json:"comments"`
	Price          float64 `json:"price"`
	IdCurrency     int     `json:"idCurrency"`
	CurrencyCode   string  `json:"currencyCode"`
	Count          int     `json:"count"`
	InShoppingCart bool    `json:"inShoppingCart"`
	Condition      string  `json:"condition"`
	Product        struct {
		Name      string `json:"enName"`
		Expansion string `json:"expansion"`
		Number    string `json:"nr"`
	} `json:"product"`
	Seller struct {
		IdUser   int    `json:"idUser"`
		Username string `json:"username"`
	}
	IsFoil    bool `json:"isFoil"`
	IsSigned  bool `json:"isSigned"`
	IsPlayset bool `json:"isPlayset"`
	IsAltered bool `json:"isAltered"`
}

type MKMClient

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

func NewMKMClient

func NewMKMClient(appToken, appSecret string) *MKMClient

func (*MKMClient) ListExpansionIds

func (mkm *MKMClient) ListExpansionIds() ([]MKMExpansionIdPair, error)

func (*MKMClient) MKMArticles

func (mkm *MKMClient) MKMArticles(id int, anyLanguage bool) ([]MKMArticle, error)

func (*MKMClient) MKMExpansions

func (mkm *MKMClient) MKMExpansions() (map[int]MKMExpansion, error)

func (*MKMClient) MKMPriceGuide

func (mkm *MKMClient) MKMPriceGuide() (MKMPriceGuide, error)

func (*MKMClient) MKMProduct

func (mkm *MKMClient) MKMProduct(id int) (*MKMProduct, error)

func (*MKMClient) MKMProductList

func (mkm *MKMClient) MKMProductList() (MKMProductList, error)

func (*MKMClient) MKMProductsInExpansion

func (mkm *MKMClient) MKMProductsInExpansion(id int) ([]MKMProduct, error)

func (*MKMClient) MKMRawPriceGuide

func (mkm *MKMClient) MKMRawPriceGuide() (string, error)

func (*MKMClient) MKMRawProductList

func (mkm *MKMClient) MKMRawProductList() (string, error)

func (*MKMClient) MKMUserArticles

func (mkm *MKMClient) MKMUserArticles(user string) ([]MKMArticle, error)

func (*MKMClient) RequestNo

func (mkm *MKMClient) RequestNo() int

type MKMExpansion

type MKMExpansion struct {
	IdExpansion int    `json:"idExpansion"`
	Name        string `json:"enName"`
	SetCode     string `json:"abbreviation"`
	Icon        int    `json:"icon"`
	ReleaseDate string `json:"releaseDate"`
	IsReleased  bool   `json:"isReleased"`
}

type MKMExpansionIdPair

type MKMExpansionIdPair struct {
	IdExpansion int
	Name        string
}

type MKMPriceGuide

type MKMPriceGuide map[int]MKMProductPriceGuide

type MKMProduct

type MKMProduct struct {
	IdProduct     int    `json:"idProduct"`
	IdMetaproduct int    `json:"idMetaproduct"`
	Name          string `json:"enName"`
	Website       string `json:"website"`
	Number        string `json:"number"`
	ExpansionName string `json:"expansionName"`
	Expansion     struct {
		IdExpansion int    `json:"idExpansion"`
		Name        string `json:"enName"`
	} `json:"expansion"`
	PriceGuide    map[string]float64 `json:"priceGuide"`
	CountArticles int                `json:"countArticles"`
	CountFoils    int                `json:"countFoils"`
}

type MKMProductList

type MKMProductList map[int]MKMProductListElement

type MKMProductListElement

type MKMProductListElement struct {
	IdProduct   int
	Name        string
	CategoryId  int
	Category    string
	ExpansionId int
	MetacardId  int
	DateAdded   string
}

type MKMProductPriceGuide

type MKMProductPriceGuide struct {
	IdProduct      int
	AvgSellPrice   float64
	LowPrice       float64
	TrendPrice     float64
	GermanProLow   float64
	SuggestedPrice float64
	FoilSell       float64
	FoilLow        float64
	FoilTrend      float64
	LowPriceEx     float64
	AvgDay1        float64
	AvgDay7        float64
	AvgDay30       float64
	FoilAvgDay1    float64
	FoilAvgDay7    float64
	FoilAvgDay30   float64
}

type PreprocessError

type PreprocessError struct {
	Extra string
	Err   error
}

func (*PreprocessError) Error

func (pe *PreprocessError) Error() string

Jump to

Keyboard shortcuts

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