source

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDataFormat     = errors.New("unexpected data format")
	ErrCardDataFormat = errors.New("unexpected card data format")
)
View Source
var ErrExceedRequestLimit = errors.New("request limit reached")

Functions

This section is empty.

Types

type BanStatus added in v0.1.7

type BanStatus string
const (
	BanStatusUnlimited   BanStatus = "UNLIMITED"
	BanStatusSemiLimited BanStatus = "SEMI_LIMITED"
	BanStatusLimited     BanStatus = "LIMITED"
	BanStatusForbidden   BanStatus = "FORBIDDEN"
)

type Card

type Card struct {
	Code      string
	JpName    string
	Rarity    string
	Condition string
	Price     int64
	Source    string
	Currency  *currency.Currency
	Game      *game.Game
	Image     string
	Score     int
}

type DetailInfo added in v0.1.7

type DetailInfo struct {
	EngName     string
	CardType    string
	Property    string
	Attribute   string
	Types       []string
	Level       string
	LinkArrows  string
	Atk         string
	Def         string
	Link        string
	EffectTypes []string
	Effect      string
	Pendulum    Pendulum
	Status      BanStatus
	Power       string
	Colors      []string
	Product     string
	Rarity      string
	Life        string
	Category    string
	Cost        string
	Counter     string
	Traits      []string
	Trigger     string
	Soul        string
}

type DetailService added in v0.1.7

type DetailService interface {
	Fetch(ctx context.Context, code, game string) (*DetailInfo, error)
}

type Pendulum added in v0.1.7

type Pendulum struct {
	EffectTypes []string
	Scale       string
	Effect      string
}

type ScrapeService

type ScrapeService interface {
	List(ctx context.Context, query, game string) ([]*Card, error)
}

func NewBigWeb

func NewBigWeb(logger *slog.Logger) ScrapeService

func NewCachedScrapeService

func NewCachedScrapeService(cache *redis.Client, cfg *config.Config, logger *slog.Logger, gs game.Service, service ...ScrapeService) ScrapeService

func NewYYT

func NewYYT(logger *slog.Logger, cs currency.Service, gs game.Service) ScrapeService

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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