Documentation ¶
Index ¶
- func AutoMigrate(db *gorm.DB)
- func BulkInsert(db *gorm.DB, cards []Card) error
- func CardImagePath(imagesDir, setCode, collectorNumber, locale string, backImage bool) string
- func CardImagesDir(imagesDir string) string
- func FillMissingTranslations(db *gorm.DB) error
- func SetImagePath(imagesDir, setCode string) string
- func SetImagesDir(imagesDir string) string
- type Card
- type Importer
- type JsonStreamer
- type MapString
- type Ruling
- type Rulings
- type Set
- type SliceString
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoMigrate ¶
func CardImagePath ¶
func CardImagesDir ¶
func FillMissingTranslations ¶ added in v0.1.1
func SetImagePath ¶
func SetImagesDir ¶
Types ¶
type Card ¶
type Card struct { ID uint `gorm:"primary_key"` EnName string `gorm:"size:255;not null;index;index:idxft_cards_en_name,class:FULLTEXT"` EsName string `gorm:"size:255;not null"` FrName string `gorm:"size:255;not null"` DeName string `gorm:"size:255;not null"` ItName string `gorm:"size:255;not null"` PtName string `gorm:"size:255;not null"` JaName string `gorm:"size:255;not null"` KoName string `gorm:"size:255;not null"` RuName string `gorm:"size:255;not null"` ZhsName string `gorm:"size:255;not null"` ZhtName string `gorm:"size:255;not null"` SetCode string `gorm:"size:6;not null;uniqueIndex:idx_cards_set_code_collector_number"` Set *Set `gorm:"foreignkey:SetCode;references:Code;constraint:OnUpdate:RESTRICT,OnDelete:RESTRICT"` CollectorNumber string `gorm:"size:255;not null;uniqueIndex:idx_cards_set_code_collector_number"` Foil bool `gorm:"not null"` NonFoil bool `gorm:"not null"` HasBackSide bool `gorm:"not null"` ReleasedAt *time.Time FrontImageUrl string `gorm:"size:255;not null"` BackImageUrl string `gorm:"size:255"` Artist string `gorm:"size:255"` ArtistBack string `gorm:"size:255"` Booster bool BorderColor string `gorm:"size:255"` CMC float32 CMCBack float32 ColorIdentity SliceString `gorm:"type:json"` ColorIndicator SliceString `gorm:"type:json"` ColorIndicatorBack SliceString `gorm:"type:json"` Colors SliceString `gorm:"type:json"` ColorsBack SliceString `gorm:"type:json"` ContentWarning bool Digital bool Finishes SliceString `gorm:"type:json"` FlavorName string `gorm:"size:255"` FlavorText string FlavorTextBack string Frame string `gorm:"size:255"` FrameEffects SliceString `gorm:"type:json"` FullArt bool Games SliceString `gorm:"type:json"` HandModifier string `gorm:"size:255"` Keywords SliceString `gorm:"type:json"` Layout string `gorm:"size:255"` LayoutBack string `gorm:"size:255"` Legalities MapString `gorm:"type:json"` LifeModifier string `gorm:"size:255"` Loyalty string `gorm:"size:255"` LoyaltyBack string `gorm:"size:255"` ManaCost string `gorm:"size:255"` ManaCostBack string `gorm:"size:255"` OracleText string OracleTextBack string Oversized bool Power string `gorm:"size:255"` PowerBack string `gorm:"size:255"` ProducedMana SliceString `gorm:"type:json"` Promo bool Rarity string `gorm:"size:255"` Reprint bool Reserved bool SecurityStamp string `gorm:"size:255"` StorySpotlight bool Textless bool Toughness string `gorm:"size:255"` ToughnessBack string `gorm:"size:255"` TypeLine string `gorm:"size:255"` TypeLineBack string `gorm:"size:255"` Variation bool Watermark string `gorm:"size:255"` WatermarkBack string `gorm:"size:255"` ScryfallID string `gorm:"size:255;not null"` OracleID string `gorm:"size:255"` MtgoID uint64 ArenaID uint64 TcgplayerID uint64 CardmarketID uint64 Rulings Rulings `gorm:"type:json"` }
type Importer ¶
type Importer struct { DataDir string ImagesDir string OnlyTheseSetCodes []string ForceDownloadData bool DownloadAssets bool DownloadOnlyEnAssets bool ForceDownloadOlderAssets bool ForceDownloadDiffSha1 bool ForceDownloadAssets bool ImageType string DisplayProgressBar bool // contains filtered or unexported fields }
func NewImporter ¶
func (*Importer) BuildCardsFromJson ¶
func (*Importer) DownloadData ¶
func (*Importer) SetDownloadConcurrency ¶
type JsonStreamer ¶
func NewJsonStreamer ¶
func NewJsonStreamer(filepath string) (*JsonStreamer, error)
func (*JsonStreamer) Get ¶
func (streamer *JsonStreamer) Get(out interface{}) error
func (*JsonStreamer) Next ¶
func (streamer *JsonStreamer) Next() bool
type Set ¶
type SliceString ¶ added in v0.5.0
type SliceString []string
func (*SliceString) Scan ¶ added in v0.5.0
func (j *SliceString) Scan(value interface{}) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.