abugames

package
v0.4.61 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ABUCard

type ABUCard struct {
	Id           string `json:"id"`
	DisplayTitle string `json:"display_title"`
	SimpleTitle  string `json:"simple_title"`

	Edition   string `json:"magic_edition_sort"`
	Condition string `json:"condition"`
	Layout    string `json:"layout"`

	Rarity   string   `json:"rarity"`
	Language []string `json:"language"`
	Title    string   `json:"title"`
	Number   string   `json:"card_number"`

	SellPrice    float64 `json:"price"`
	SellQuantity int     `json:"quantity"`
	BuyQuantity  int     `json:"buy_list_quantity"`
	BuyPrice     float64 `json:"buy_price"`
	TradePrice   float64 `json:"trade_price"`
}

type ABUClient

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

func NewABUClient

func NewABUClient() *ABUClient

func NewABUClientWithBearer added in v0.4.48

func NewABUClientWithBearer(token string) *ABUClient

func (*ABUClient) Get added in v0.4.48

func (abu *ABUClient) Get(url string) (*http.Response, error)

func (*ABUClient) GetProduct

func (abu *ABUClient) GetProduct(pageStart int) (*ABUProduct, error)

func (*ABUClient) GetSealedProduct added in v0.4.49

func (abu *ABUClient) GetSealedProduct(pageStart int) (*ABUResponse, error)

func (*ABUClient) GetTotalItems added in v0.4.49

func (abu *ABUClient) GetTotalItems() (int, error)

Use the URL as is, with just one row requested to fetch the number of items

func (*ABUClient) GetTotalSealedItems added in v0.4.49

func (abu *ABUClient) GetTotalSealedItems() (int, error)

func (*ABUClient) Post added in v0.4.48

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

func (*ABUClient) SetCartBuylist added in v0.4.48

func (abu *ABUClient) SetCartBuylist(abuId string, qty int) (*CartResponse, error)

func (*ABUClient) SetCartInventory added in v0.4.48

func (abu *ABUClient) SetCartInventory(abuId string, qty int) (*CartResponse, error)

type ABUGames

type ABUGames struct {
	LogCallback mtgban.LogCallbackFunc

	MaxConcurrency int
	// contains filtered or unexported fields
}

func NewScraper

func NewScraper() *ABUGames

func (*ABUGames) Buylist

func (abu *ABUGames) Buylist() (mtgban.BuylistRecord, error)

func (*ABUGames) Info

func (abu *ABUGames) Info() (info mtgban.ScraperInfo)

func (*ABUGames) InfoForScraper added in v0.4.48

func (abu *ABUGames) InfoForScraper(name string) mtgban.ScraperInfo

func (*ABUGames) Inventory

func (abu *ABUGames) Inventory() (mtgban.InventoryRecord, error)

func (*ABUGames) TraderNames added in v0.4.32

func (abu *ABUGames) TraderNames() []string

type ABUGamesSealed added in v0.4.49

type ABUGamesSealed struct {
	LogCallback mtgban.LogCallbackFunc

	MaxConcurrency int
	// contains filtered or unexported fields
}

func NewScraperSealed added in v0.4.49

func NewScraperSealed() *ABUGamesSealed

func (*ABUGamesSealed) Buylist added in v0.4.49

func (abu *ABUGamesSealed) Buylist() (mtgban.BuylistRecord, error)

func (*ABUGamesSealed) Info added in v0.4.49

func (abu *ABUGamesSealed) Info() (info mtgban.ScraperInfo)

func (*ABUGamesSealed) InfoForScraper added in v0.4.49

func (abu *ABUGamesSealed) InfoForScraper(name string) mtgban.ScraperInfo

func (*ABUGamesSealed) Inventory added in v0.4.49

func (abu *ABUGamesSealed) Inventory() (mtgban.InventoryRecord, error)

func (*ABUGamesSealed) TraderNames added in v0.4.49

func (abu *ABUGamesSealed) TraderNames() []string

type ABUProduct

type ABUProduct struct {
	Grouped struct {
		ProductId struct {
			Count  int `json:"ngroups"`
			Groups []struct {
				GroupValue string `json:"groupValue"`
				Doclist    struct {
					Docs []ABUCard `json:"docs"`
				} `json:"doclist"`
			} `json:"groups"`
		} `json:"product_id"`
	} `json:"grouped"`
}

type ABUResponse added in v0.4.49

type ABUResponse struct {
	Response struct {
		NumFound      int       `json:"numFound"`
		Start         int       `json:"start"`
		NumFoundExact bool      `json:"numFoundExact"`
		Docs          []ABUCard `json:"docs"`
	} `json:"response"`
}

type CartRequest added in v0.4.48

type CartRequest struct {
	ItemId   string `json:"item_id"`
	Quantity int    `json:"quantity"`
	// Ignored on buylist
	Call string `json:"call,omitempty"`
}

type CartResponse added in v0.4.48

type CartResponse struct {
	BuyList string `json:"buyList"`
	NqData  struct {
		Maxqty int `json:"maxqty"`
	} `json:"nqData"`
	ConditionRowID int `json:"condition_row_id"`
	Resp           struct {
		Exception any   `json:"exception"`
		Headers   []any `json:"headers"`
		Original  any   `json:"original"`
	} `json:"resp"`

	Message    string `json:"message"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
}

Jump to

Keyboard shortcuts

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