Documentation ¶
Index ¶
- func Validate(input interface{}) (err error)
- type Archetype
- type ArchetypesService
- type BanListInfo
- type Card
- type CardSet
- type CardSetInfo
- type CardSetInfoOneOptions
- type CardSetInfoService
- type CardSetsService
- type Cards
- type CardsListOptions
- type CardsService
- type CheckDBVersionService
- type Client
- type DBInformation
- type Image
- type Meta
- type Misc
- type Prices
- type RandomCardsService
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArchetypesService ¶
type ArchetypesService struct {
// contains filtered or unexported fields
}
ArchetypesService handles communication with the archetype related methods of the Yu-Gi-Oh! API by YGOPRODeck.
type BanListInfo ¶
type BanListInfo struct { TCG string `json:"ban_tcg"` OCG string `json:"ban_ocg"` Goat string `json:"ban_goat"` }
BanListInfo if card not in ban list, it will NOT show up.
type Card ¶
type Card struct { ID int32 `json:"id"` Name string `json:"name"` Type string `json:"type"` FrameType string `json:"frameType"` Description string `json:"desc"` Race string `json:"race"` Archetype string `json:"archetype"` Sets []Set `json:"card_sets"` Images []Image `json:"card_images"` // array, but this API currently only returns one Prices []Prices `json:"card_prices"` Misc []Misc `json:"misc_info"` // Monster Card only Atk int `json:"atk"` Def int `json:"def"` Level int `json:"level"` Attribute string `json:"attribute"` // Pendulum Monster Card only Scale int `json:"scale"` // Link Monster Card only Link int `json:"linkval"` // Top, Bottom, Left, Right, Bottom-Left, Bottom-Right, Top-Left, Top-Right LinkMarkers []string `json:"linkmarkers"` // Ban Card only BanListInfo BanListInfo `json:"banlist_info"` }
Card if a piece of response info is empty or null then it will NOT show up.
type CardSet ¶
type CardSet struct { Name string `json:"set_name"` Code string `json:"set_code"` CardCounts int `json:"num_of_cards"` ReleasedDate string `json:"tcg_date"` }
CardSet ...
type CardSetInfo ¶ added in v1.2.0
type CardSetInfo struct { ID int `json:"id"` Name string `json:"name"` Price float32 `json:"set_price,string"` SetName string `json:"set_name"` Code string `json:"set_code"` Rarity string `json:"set_rarity"` }
CardSetInfo ...
type CardSetInfoOneOptions ¶ added in v1.2.0
type CardSetInfoOneOptions struct {
Code string `url:"setcode" validate:"required"`
}
CardSetInfoOneOptions ...
type CardSetInfoService ¶ added in v1.2.0
type CardSetInfoService struct {
// contains filtered or unexported fields
}
CardSetInfoService ...
func (*CardSetInfoService) One ¶ added in v1.2.0
func (s *CardSetInfoService) One(opt *CardSetInfoOneOptions) (*CardSetInfo, *http.Response, error)
One ...
type CardSetsService ¶
type CardSetsService struct {
// contains filtered or unexported fields
}
CardSetsService handles communication with the card sets related methods of the Yu-Gi-Oh! API by YGOPRODeck.
type CardsListOptions ¶
type CardsListOptions struct { // must be comma separated. You can't use this with Name field. IDs string `url:"id,omitempty"` Name string `url:"name,omitempty"` Q string `url:"fname,omitempty"` KonamiID string `url:"konami_id,omitempty"` Type string `url:"type,omitempty"` Race string `url:"race,omitempty"` Archetype string `url:"archetype,omitempty"` Set string `url:"cardset,omitempty"` BanList string `url:"banlist,omitempty,oneof=TCG OCG Goat"` HasEffect bool `url:"has_effect,omitempty"` Sort string `url:"sort,omitempty" validate:"omitempty,oneof=atk def name type level id new"` // goat, ocg goat, speed duel, rush duel, duel links // Duel Links is not 100% accurate but is close. Format string `url:"format,omitempty"` // it can use "lt" (less than), "lte" (less than equals to), "gt" (greater than), "gte" (greater than equals to) Atk string `url:"atk,omitempty"` Def string `url:"def,omitempty"` Level string `url:"level,omitempty"` Attribute string `url:"attribute,omitempty" validate:"omitempty,oneof=dark earth fire light water wind divine"` // Pendulum Monster Card only Scale int `url:"scale,omitempty"` // Link Monster Card only Link int `url:"link,omitempty"` LinkMarker string `url:"linkmarker,omitempty"` // If set "yes", return Misc Misc string `url:"misc,omitempty" validate:"omitempty,eq=yes"` Staple string `url:"staple,omitempty"` Language string `url:"language,omitempty"` Num int `url:"num,omitempty"` Offset int `url:"offset,omitempty"` }
CardsListOptions specifies the optional parameters to various CardsService.List methods.
type CardsService ¶
type CardsService struct {
// contains filtered or unexported fields
}
CardsService handles communication with the cards related methods of the Yu-Gi-Oh! API by YGOPRODeck.
func (*CardsService) List ¶
func (s *CardsService) List(opt *CardsListOptions) (*Cards, *http.Response, error)
List the cards
type CheckDBVersionService ¶ added in v1.2.0
type CheckDBVersionService struct {
// contains filtered or unexported fields
}
CheckDBVersionService ...
func (*CheckDBVersionService) One ¶ added in v1.2.0
func (s *CheckDBVersionService) One() (DBInformation, *http.Response, error)
One ...
type Client ¶
type Client struct { BaseURL *url.URL UserAgent string Cards *CardsService CardSets *CardSetsService CardSetInfo *CardSetInfoService RandomCards *RandomCardsService Archetypes *ArchetypesService CheckDBVersion *CheckDBVersionService // contains filtered or unexported fields }
Client ...
type DBInformation ¶ added in v1.2.0
type DBInformation struct { Version string `json:"database_version"` LastUpdated string `json:"last_update" validate:"datetime"` }
DBInformation ...
type Image ¶
type Image struct { ID int32 `json:"id"` URL string `json:"image_url"` SmallURL string `json:"image_url_small"` CroppedURL string `json:"image_url_cropped"` }
Image card image.
type Meta ¶ added in v1.2.0
type Meta struct { CurrentRows int `json:"current_rows"` TotalRows int `json:"total_rows"` RowsRemaining int `json:"rows_remaining"` TotalPages int `json:"total_pages"` PagesRemaining int `json:"pages_remaining"` // omitted on last page NextPage string `json:"next_page,omitempty"` NextPageOffset int `json:"next_page_offset,omitempty"` // omitted if not on the last page PreviousPage string `json:"previous_page,omitempty"` PreviousPageOffset int `json:"previous_page_offset,omitempty"` }
Meta about pagination
type Misc ¶
type Misc struct { // The Old/Temporary/Translated name BetaName string `json:"beta_name"` // The number of times a card has been viewed in ygoprodeck (does not include API/external views) Views int `json:"views"` // The available formats the card is in (tcg, ocg, goat, ocg goat, duel links, rush duel or speed duel). Formats []string `json:"formats"` // The original date the card was released in the TCG. TCGDate string `json:"tcg_date"` // The original date the card was released in the OCG. OCGDate string `json:"ocg_date"` // If the card is treated as another card. // For example, Harpie Lady 1,2,3 are treated as Harpie Lady. TreatedAs string `json:"treated_as"` }
Misc if you want to get, set "yes" to Misc param
type Prices ¶
type Prices struct { // Euro Cardmarket float32 `json:"cardmarket_price,string"` // Dollar TCGPlayer float32 `json:"tcgplayer_price,string"` Ebay float32 `json:"ebay_price,string"` Amazon float32 `json:"amazon_price,string"` CoolStuffInc float32 `json:"coolstuffinc_price,string"` }
Prices card prices Only Cardmarket price is euro.
type RandomCardsService ¶
type RandomCardsService struct {
// contains filtered or unexported fields
}
RandomCardsService handles communication with the random cards related methods of the Yu-Gi-Oh! API by YGOPRODeck.