cardkingdom

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Preprocess

func Preprocess(card CKCard) (*mtgmatcher.InputCard, error)

Types

type CKCard

type CKCard struct {
	Id              int             `json:"id"`
	SKU             string          `json:"sku"`
	URL             string          `json:"url"`
	Name            string          `json:"name"`
	Variation       string          `json:"variation"`
	Edition         string          `json:"edition"`
	IsFoil          string          `json:"is_foil"`
	SellPrice       string          `json:"price_retail"`
	SellQuantity    int             `json:"qty_retail"`
	BuyPrice        string          `json:"price_buy"`
	BuyQuantity     int             `json:"qty_buying"`
	ConditionValues conditionValues `json:"condition_values"`

	// Only from GetHotBuylist()
	HotPrice  string `json:"price"`
	ShortName string `json:"short_name,omitempty"`
}

type CKClient

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

func NewCKClient

func NewCKClient() *CKClient

func (*CKClient) GetHotBuylist

func (ck *CKClient) GetHotBuylist() ([]CKCard, error)

func (*CKClient) GetPriceList

func (ck *CKClient) GetPriceList() ([]CKCard, error)

func (*CKClient) GetSealedList

func (ck *CKClient) GetSealedList() ([]CKCard, error)

type Cardkingdom

type Cardkingdom struct {
	LogCallback mtgban.LogCallbackFunc
	Partner     string
	PreserveOOS bool
	// contains filtered or unexported fields
}

func NewScraper

func NewScraper() *Cardkingdom

func (*Cardkingdom) Buylist

func (ck *Cardkingdom) Buylist() (mtgban.BuylistRecord, error)

func (*Cardkingdom) Info

func (ck *Cardkingdom) Info() (info mtgban.ScraperInfo)

func (*Cardkingdom) Inventory

func (ck *Cardkingdom) Inventory() (mtgban.InventoryRecord, error)

type CardkingdomSealed

type CardkingdomSealed struct {
	LogCallback mtgban.LogCallbackFunc
	Partner     string
	// contains filtered or unexported fields
}

func NewScraperSealed

func NewScraperSealed() *CardkingdomSealed

func (*CardkingdomSealed) Buylist

func (ck *CardkingdomSealed) Buylist() (mtgban.BuylistRecord, error)

func (*CardkingdomSealed) Info

func (ck *CardkingdomSealed) Info() (info mtgban.ScraperInfo)

func (*CardkingdomSealed) Inventory

func (ck *CardkingdomSealed) Inventory() (mtgban.InventoryRecord, error)

type CartRequest added in v0.4.48

type CartRequest struct {
	ProductID string `json:"product_id"`
	Style     string `json:"style"`
	Quantity  int    `json:"quantity"`
}

type CartResponse added in v0.4.50

type CartResponse struct {
	AutoValidateCart  bool      `json:"auto_validate_cart"`
	ForceValidateCart bool      `json:"force_validate_cart"`
	HasPriceChange    bool      `json:"has_price_change"`
	HasQuantityChange bool      `json:"has_quantity_change"`
	ID                int       `json:"id"`
	ItemCount         int       `json:"item_count"`
	LastAccess        time.Time `json:"last_access"`
	LineitemCount     int       `json:"lineitem_count"`
	Lineitems         []struct {
		Product struct {
			Model           string `json:"model"`
			Width           any    `json:"width"`
			Height          any    `json:"height"`
			Depth           any    `json:"depth"`
			Weight          int    `json:"weight"`
			IsShiny         bool   `json:"is_shiny"`
			ProductSlug     string `json:"product_slug"`
			CategorySlug    string `json:"category_slug"`
			URI             string `json:"uri"`
			MaxQtyAvailable int    `json:"max_qty_available"`
			PriceBuy        string `json:"price_buy"`
			PriceSale       any    `json:"price_sale"`
			OrderLimit      any    `json:"order_limit"`
			BuyLimit        int    `json:"buy_limit"`
			BorderClass     string `json:"border_class"`
			Rarity          string `json:"rarity"`
			ShortName       string `json:"short_name"`
			IsActive        bool   `json:"is_active"`
		} `json:"product"`
		Title                      string `json:"title"`
		Edition                    string `json:"edition"`
		Rarity                     string `json:"rarity"`
		Variation                  string `json:"variation"`
		Weight                     int    `json:"weight"`
		AllowInternationalShipping bool   `json:"allow_international_shipping"`
		ID                         int    `json:"id"`
		IsPresale                  bool   `json:"is_presale"`
		ShipDate                   string `json:"ship_date"`
		IsShiny                    bool   `json:"is_shiny"`
		DefaultImage               string `json:"default_image"`
		Name                       string `json:"name"`
		Price                      string `json:"price"`
		PriceAfterCoupon           string `json:"price_after_coupon"`
		OriginalPrice              string `json:"original_price"`
		ProductID                  int    `json:"product_id"`
		Style                      string `json:"style"`
		Total                      string `json:"total"`
		Qty                        int    `json:"qty"`
		OriginalQuantity           int    `json:"original_quantity"`
		IsBuying                   bool   `json:"is_buying"`
		IsSelling                  int    `json:"is_selling"`
		IsTaxable                  int    `json:"is_taxable"`
		CouponDiscount             string `json:"coupon_discount"`
	} `json:"lineitems"`
	PremiumOffer               string `json:"premium_offer"`
	Status                     string `json:"status"`
	Subtotal                   string `json:"subtotal"`
	SubtotalStorecredit        string `json:"subtotal_storecredit"`
	Type                       string `json:"type"`
	NeedsCartMergeNotification bool   `json:"needs_cart_merge_notification"`
}

type CookieClient added in v0.4.37

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

func NewCookieClient added in v0.4.37

func NewCookieClient(session string) *CookieClient

func (*CookieClient) EmptyCartBuylist added in v0.4.52

func (ck *CookieClient) EmptyCartBuylist(cartToken string) error

func (*CookieClient) EmptyCartInventory added in v0.4.52

func (ck *CookieClient) EmptyCartInventory(cartToken string) error

func (*CookieClient) Get added in v0.4.48

func (ck *CookieClient) Get(link string) (*http.Response, error)

func (*CookieClient) Post added in v0.4.48

func (ck *CookieClient) Post(url, contentType string, reader io.Reader) (*http.Response, error)

func (*CookieClient) SetCartBuylist added in v0.4.48

func (ck *CookieClient) SetCartBuylist(ckId string, qty int) (*CartResponse, error)

func (*CookieClient) SetCartInventory added in v0.4.48

func (ck *CookieClient) SetCartInventory(ckId, cond string, qty int) (*CartResponse, error)

Jump to

Keyboard shortcuts

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