mtgbulk

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card added in v0.0.3

type Card struct {
	ID        string `json:"id"`
	OracleID  string `json:"oracle_id"`
	Name      string `json:"name"`
	LocalName string `json:"printed_name"`
	Lang      string `json:"lang"`
	URI       string `json:"uri"`
}

type CardPrice

type CardPrice struct {
	Price    float32
	Foil     bool
	Currency CurrencyType
	Quantity int

	Platform PlatformType
	Trader   string
	URL      string
}

func (*CardPrice) SellerFullName added in v0.0.7

func (cp *CardPrice) SellerFullName() string

type CardResult

type CardResult struct {
	Available bool
	Prices    []CardPrice
}

type CurrencyType

type CurrencyType int
const (
	RUR CurrencyType = iota
	USD CurrencyType = iota
)

func (CurrencyType) MarshalJSON

func (c CurrencyType) MarshalJSON() ([]byte, error)

func (CurrencyType) String

func (c CurrencyType) String() string

type InMemoryLibrary added in v0.0.3

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

func (*InMemoryLibrary) CardAliases added in v0.0.3

func (lib *InMemoryLibrary) CardAliases(cardname string) (map[string]bool, error)

func (*InMemoryLibrary) EnglishName added in v0.0.5

func (lib *InMemoryLibrary) EnglishName(cardname string) (string, error)

type Library added in v0.0.3

type Library interface {
	CardAliases(string) (map[string]bool, error)
	EnglishName(string) (string, error)
}

func NewInMemoryLibrary added in v0.0.3

func NewInMemoryLibrary(dumpPath string) (Library, error)

type NamesRequest

type NamesRequest struct {
	Cards map[string]int

	DeliveryFee int
	// contains filtered or unexported fields
}

func NewNamesRequest

func NewNamesRequest() NamesRequest

type NamesResult

type NamesResult struct {
	AllSortedCards map[string]CardResult

	MinPricesNoDelivery          map[string][]CardPrice
	WithDeliveryByEliminateFewer map[string]CardPrice
	MinPricesMatrix              *PossessionMatrix
}

func ProcessByNames

func ProcessByNames(req NamesRequest) (*NamesResult, error)

func ProcessText

func ProcessText(r io.Reader) (*NamesResult, error)

type PlatformType

type PlatformType int
const (
	MtgSale      PlatformType = iota
	MtgTrade     PlatformType = iota
	SpellMarket  PlatformType = iota
	AutumnsMagic PlatformType = iota
	TopDeck      PlatformType = iota
)

func (PlatformType) String added in v0.0.7

func (pt PlatformType) String() string

type PossessionMatrix

type PossessionMatrix struct {
	SellerCards map[string]map[string]int
	CardSellers map[string]map[string]int
}

func NewPossessionMatrix

func NewPossessionMatrix() *PossessionMatrix

func (*PossessionMatrix) AddCard

func (m *PossessionMatrix) AddCard(seller, card string, price int)

type PossessionTable

type PossessionTable struct {
	Sellers, Cards                     []string
	Prices                             [][]int
	SellerCardsTotal, SellerPriceTotal []int
	CardSellersTotal                   []int
	MinPrice, AvgPrice, MedianPrice    []int
}

func NewPossessionTable

func NewPossessionTable(m *PossessionMatrix) *PossessionTable

func (*PossessionTable) ToTextTable

func (t *PossessionTable) ToTextTable(out io.Writer) error

func (*PossessionTable) ToXlsxSheet

func (t *PossessionTable) ToXlsxSheet(out *xlsx.Sheet, minPrices map[string]int) error

Jump to

Keyboard shortcuts

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