feat: init client
This commit is contained in:
88
models/card.go
Normal file
88
models/card.go
Normal file
@@ -0,0 +1,88 @@
|
||||
package models
|
||||
|
||||
// Card contains every informations about a specific card.
|
||||
type Card struct {
|
||||
// ID Globally unique card ID based on the set ID and the cards ID within the set.
|
||||
ID string `json:"id"`
|
||||
|
||||
// LocalID indexing this card within its set, usually just its number.
|
||||
LocalID string `json:"localId"`
|
||||
|
||||
// Name is the card name
|
||||
Name string `json:"name"`
|
||||
|
||||
// Image url without the extension and quality.
|
||||
Image *string `json:"image"`
|
||||
|
||||
// Illustrator of the card.
|
||||
Illustrator *string `json:"illustrator"`
|
||||
|
||||
// Rarity of the card.
|
||||
Rarity string `json:"rarity"`
|
||||
|
||||
// Category of the card.
|
||||
Category string `json:"category"`
|
||||
|
||||
// Variants possible card variants
|
||||
Variants *CardVariant `json:"variants"`
|
||||
|
||||
// Set the card belongs to.
|
||||
Set SetResume `json:"set"`
|
||||
|
||||
// DexID Pokémon Pokédex IDs (multiple if multiple pokémon appears on the card).
|
||||
DexID []int `json:"dexId"`
|
||||
|
||||
// Hp of the pokemon
|
||||
Hp int `json:"hp"`
|
||||
|
||||
// Types of the pokemon.
|
||||
Types []string `json:"types"`
|
||||
|
||||
// EvolveFrom Name of the pokemon this one evolves from.
|
||||
EvolveFrom *string `json:"evolveFrom"`
|
||||
|
||||
// Description of Pokémon like in Pokédex
|
||||
Description *string `json:"description"`
|
||||
|
||||
// Level of the Pokémon.
|
||||
Level *string `json:"level"`
|
||||
|
||||
// Stage of the Pokémon.
|
||||
Stage *string `json:"stage"`
|
||||
|
||||
// Suffix of the Pokémon.
|
||||
Suffix *string `json:"suffix"`
|
||||
|
||||
// Item the Pokémon have.
|
||||
Item CardItem `json:"item"`
|
||||
|
||||
// Abilities of the card.
|
||||
Abilities []CardAbility `json:"abilities"`
|
||||
|
||||
// Attacks of the card.
|
||||
Attacks []CardAttack `json:"attacks"`
|
||||
|
||||
// Weaknesses of the card.
|
||||
Weaknesses []CardWeakResistance `json:"weaknesses"`
|
||||
|
||||
// Resistances of the card.
|
||||
Resistances []CardWeakResistance `json:"resistances"`
|
||||
|
||||
// Retreat cost of the card.
|
||||
Retreat int `json:"retreat"`
|
||||
|
||||
// Effect of the card.
|
||||
Effect *string `json:"effect"`
|
||||
|
||||
// TrainerType ???.
|
||||
TrainerType *string `json:"trainerType"`
|
||||
|
||||
// EnergyType of the card.
|
||||
EnergyType *string `json:"energyType"`
|
||||
|
||||
// RegulationMark of the card.
|
||||
RegulationMark *string `json:"regulationMark"`
|
||||
|
||||
// Legal card ability to be played in tournaments.
|
||||
Legal Legal `json:"legal"`
|
||||
}
|
||||
13
models/card_ability.go
Normal file
13
models/card_ability.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package models
|
||||
|
||||
// CardAbility Describes a single ability of a pokemon.
|
||||
type CardAbility struct {
|
||||
// Ability type (language dependant).
|
||||
Type string `json:"type"`
|
||||
|
||||
// Name of the ability.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Effect of the ability.
|
||||
Effect string `json:"effect"`
|
||||
}
|
||||
16
models/card_attack.go
Normal file
16
models/card_attack.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
// CardAttack describes a single attack of a pokemon, for example 'Confuse Ray'.
|
||||
type CardAttack struct {
|
||||
// Name of the attack
|
||||
Name string `json:"name"`
|
||||
|
||||
// Costs of the attack in the same order as listed on the card.
|
||||
Costs []string `json:"cost"`
|
||||
|
||||
// Effect/Description of the attack, may be null for attacks without text.
|
||||
Effect *string `json:"effect"`
|
||||
|
||||
// Damage the attack deals. May just be a number like '30', but can also be a multiplier like 'x20'.
|
||||
Damage string `json:"damage"`
|
||||
}
|
||||
10
models/card_item.go
Normal file
10
models/card_item.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package models
|
||||
|
||||
// CardItem represents an item.
|
||||
type CardItem struct {
|
||||
// Name of the item.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Effect of the item.
|
||||
Effect string `json:"effect"`
|
||||
}
|
||||
16
models/card_resume.go
Normal file
16
models/card_resume.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
// CardResume contains basic informations about a specific card.
|
||||
type CardResume struct {
|
||||
// ID unique card ID based on the set ID and the cards ID within the set.
|
||||
ID string `json:"id"`
|
||||
|
||||
// LocalID indexing this card within its set, usually just its number.
|
||||
LocalID string `json:"localId"`
|
||||
|
||||
// Name of the card
|
||||
Name string `json:"name"`
|
||||
|
||||
// Image url of the card without the extension and quality.
|
||||
Image string `json:"image"`
|
||||
}
|
||||
19
models/card_variant.go
Normal file
19
models/card_variant.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package models
|
||||
|
||||
// CardVariant represents the possible variants of a card.
|
||||
type CardVariant struct {
|
||||
// Normal it's a basic card.
|
||||
Normal bool `json:"normal"`
|
||||
|
||||
// Reverse the card have some shine behind colored content.
|
||||
Reverse bool `json:"reverse"`
|
||||
|
||||
// Holo the card picture have some shine to it.
|
||||
Holo bool `json:"holo"`
|
||||
|
||||
// FirstEdition the card contains a First Edition Stamp (only Base serie).
|
||||
FirstEdition bool `json:"firstEdition"`
|
||||
|
||||
// WPromo The card has a wPromo stamp on it.
|
||||
WPromo bool `json:"wPromo"`
|
||||
}
|
||||
10
models/card_weak_resistance.go
Normal file
10
models/card_weak_resistance.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package models
|
||||
|
||||
// CardWeakResistance represent the weakeness or resistance of a card.
|
||||
type CardWeakResistance struct {
|
||||
// Type affected.
|
||||
Type string `json:"type"`
|
||||
|
||||
// Value represents the multiplier but can be an number depending of the card.
|
||||
Value string `json:"value"`
|
||||
}
|
||||
10
models/legal.go
Normal file
10
models/legal.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package models
|
||||
|
||||
// Legal informs about legality of the card in restricted tournament.
|
||||
type Legal struct {
|
||||
// Standard card usable is standard tournaments.
|
||||
Standard bool `json:"standard"`
|
||||
|
||||
// Expanded card usable in expended tournament
|
||||
Expanded bool `json:"expanded"`
|
||||
}
|
||||
19
models/serie.go
Normal file
19
models/serie.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// Package models defines the data structures used in the Pokémon TCG database.
|
||||
package models
|
||||
|
||||
// Serie represent the Pokémon TCG serie.
|
||||
type Serie struct {
|
||||
/**
|
||||
* the list of sets the Serie contains
|
||||
*/
|
||||
Sets []SetResume `json:"sets"`
|
||||
|
||||
// ID unique of the serie.
|
||||
ID string `json:"id"`
|
||||
|
||||
// Name of the serie.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Logo of the Serie (basically also the first set logo).
|
||||
Logo string `json:"logo"`
|
||||
}
|
||||
13
models/serie_resume.go
Normal file
13
models/serie_resume.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package models
|
||||
|
||||
// SerieResume resume of the serie.
|
||||
type SerieResume struct {
|
||||
// ID of the serie.
|
||||
ID string `json:"id"`
|
||||
|
||||
// Name of the serie.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Logo of the serie.
|
||||
Logo string `json:"logo"`
|
||||
}
|
||||
34
models/set.go
Normal file
34
models/set.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package models
|
||||
|
||||
// Set represents the set.
|
||||
type Set struct {
|
||||
// Id Globally unique set ID.
|
||||
ID string `json:"id"`
|
||||
|
||||
// Name of the set.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Logo incomplete URL.
|
||||
Logo string `json:"logo"`
|
||||
|
||||
// Symbol incomplete URL.
|
||||
Symbol string `json:"symbol"`
|
||||
|
||||
// Serie which the set is a part.
|
||||
Serie SerieResume `json:"serie"`
|
||||
|
||||
// TcgOnline code.
|
||||
TcgOnline string `json:"tcgOnline"`
|
||||
|
||||
// ReleaseDate of the set (yyyy-mm-dd).
|
||||
ReleaseDate string `json:"releaseDate"`
|
||||
|
||||
// Legal the set legality (won't indicate if a card is banned)
|
||||
Legal Legal `json:"legal"`
|
||||
|
||||
// CardCount the number of card in the set
|
||||
CardCount SetCardCount `json:"cardCount"`
|
||||
|
||||
// Cards contained in this set.
|
||||
Cards []CardResume `json:"cards"`
|
||||
}
|
||||
22
models/set_card_count.go
Normal file
22
models/set_card_count.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
// SetCardCount informations about the number of cards in the set.
|
||||
type SetCardCount struct {
|
||||
// Total of the number of cards.
|
||||
Total int `json:"total"`
|
||||
|
||||
// Official is the number of cards officially (on the bottom of each cards).
|
||||
Official int `json:"official"`
|
||||
|
||||
// Normal number of cards having a normal version.
|
||||
Normal int `json:"normal"`
|
||||
|
||||
// Reverse number of cards having an reverse version.
|
||||
Reverse int `json:"reverse"`
|
||||
|
||||
// Holo number of cards having an holo version.
|
||||
Holo int `json:"holo"`
|
||||
|
||||
// FirstEd number of possible cards.
|
||||
FirstEd int `json:"firstEd"`
|
||||
}
|
||||
10
models/set_card_count_resume.go
Normal file
10
models/set_card_count_resume.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package models
|
||||
|
||||
// SetCardCountResume card count resume of the set.
|
||||
type SetCardCountResume struct {
|
||||
// Total of number of cards.
|
||||
Total int `json:"total"`
|
||||
|
||||
// Official number of cards officially (on the bottom of each cards).
|
||||
Official int `json:"official"`
|
||||
}
|
||||
19
models/set_resume.go
Normal file
19
models/set_resume.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package models
|
||||
|
||||
// SetResume resume of the set.
|
||||
type SetResume struct {
|
||||
// ID Globally unique set ID.
|
||||
ID string
|
||||
|
||||
// Name of the set.
|
||||
Name string
|
||||
|
||||
// Logo incomplete URL.
|
||||
Logo string
|
||||
|
||||
// Symbol incomplete URL.
|
||||
Symbol string
|
||||
|
||||
// CardCount number of card in the set.
|
||||
CardCount SetCardCountResume
|
||||
}
|
||||
Reference in New Issue
Block a user