Documentation ¶
Index ¶
- Constants
- func HandleServerResponse(apiErr APIError, res http.ResponseWriter)
- type APIError
- type APIHealth
- type BatchCardData
- type BatchCardIDs
- type BatchData
- type Card
- type CardDataMap
- type CardIDs
- type CardNames
- type Cards
- type Content
- type DeckList
- type DeckListBreakdown
- type DownstreamItem
- type IdentifierSlice
- type QuotedToken
- type ResourceDataMap
- type Status
- type Success
- type SuggestedDecks
Constants ¶
View Source
const ( Up = "Up" Down = "Down" )
Variables ¶
This section is empty.
Functions ¶
func HandleServerResponse ¶
func HandleServerResponse(apiErr APIError, res http.ResponseWriter)
Types ¶
type APIError ¶
func (*APIError) HandleServerResponse ¶
func (e *APIError) HandleServerResponse(res http.ResponseWriter)
type APIHealth ¶
type APIHealth struct { Version string `json:"version"` Downstream []DownstreamItem `json:"downstream"` }
type BatchCardData ¶
type BatchCardData[IS IdentifierSlice] struct { CardInfo CardDataMap `json:"cardInfo"` UnknownResources IS `json:"unknownResources"` }
type BatchCardIDs ¶
type BatchCardIDs struct {
CardIDs CardIDs `json:"cardIDs" validate:"required,ygocardids"`
}
type BatchData ¶
type BatchData[IS IdentifierSlice] interface { BatchCardData[IS] }
type Card ¶
type Card struct { CardID string `db:"card_number" json:"cardID"` CardColor string `db:"card_color" json:"cardColor"` CardName string `db:"card_name" json:"cardName"` CardAttribute string `db:"card_attribute" json:"cardAttribute"` CardEffect string `db:"card_effect" json:"cardEffect"` MonsterType *string `db:"monster_type" json:"monsterType,omitempty"` MonsterAttack *uint16 `db:"monster_attack" json:"monsterAttack,omitempty"` MonsterDefense *uint16 `db:"monster_defense" json:"monsterDefense,omitempty"` }
func (Card) IsExtraDeckMonster ¶
type CardDataMap ¶
func (CardDataMap) FindMissingIDs ¶
func (cardData CardDataMap) FindMissingIDs(cardIDs CardIDs) CardIDs
finds all card IDs not found in CardDataMap keys
func (CardDataMap) FindMissingNames ¶
func (cardData CardDataMap) FindMissingNames(cardNames CardNames) CardNames
finds all card IDs not found in CardDataMap keys
type DeckList ¶
type DeckList struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id"` Name string `bson:"name" json:"name" validate:"required,decklistname"` ContentB64 string `bson:"content" json:"content" validate:"required,base64"` VideoUrl string `bson:"videoUrl" json:"videoUrl" validate:"omitempty,url"` UniqueCards CardIDs `bson:"uniqueCards" json:"uniqueCards" validate:"omitempty"` DeckMascots CardIDs `bson:"deckMascots" json:"deckMascots" validate:"omitempty,deckmascots"` NumMainDeckCards int `bson:"numMainDeckCards" json:"numMainDeckCards"` NumExtraDeckCards int `bson:"numExtraDeckCards" json:"numExtraDeckCards"` Tags []string `bson:"tags" json:"tags" validate:"required"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"` MainDeck []Content `bson:"mainDeck,omitempty" json:"mainDeck,omitempty"` ExtraDeck []Content `bson:"extraDeck,omitempty" json:"extraDeck,omitempty"` }
type DeckListBreakdown ¶
type DeckListBreakdown struct { CardQuantity map[string]int CardIDs CardIDs InvalidIDs CardIDs AllCards CardDataMap MainDeck Cards ExtraDeck Cards NumMainDeckCards int NumExtraDeckCards int }
func (*DeckListBreakdown) GetQuantities ¶
func (dlb *DeckListBreakdown) GetQuantities() ([]Content, []Content)
func (DeckListBreakdown) ListStringCleanup ¶
func (dlb DeckListBreakdown) ListStringCleanup() string
func (*DeckListBreakdown) Partition ¶
func (dlb *DeckListBreakdown) Partition()
func (*DeckListBreakdown) Sort ¶
func (dlb *DeckListBreakdown) Sort()
type DownstreamItem ¶
type IdentifierSlice ¶
type QuotedToken ¶
type QuotedToken = string
type ResourceDataMap ¶
type ResourceDataMap interface { CardDataMap }
type SuggestedDecks ¶
type SuggestedDecks struct {
FeaturedIn *[]DeckList `json:"featuredIn"`
}
Click to show internal directories.
Click to hide internal directories.