storage

package
v0.0.0-...-8f0799a Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBookmarkRepo

func NewBookmarkRepo(db *gorm.DB) *bookmarkRepo

Types

type AssociationType

type AssociationType int
const (
	AssociationUnknown AssociationType = iota
	AssociationSideboard
	AssociationMain
	AssociationCommander
	AssociationCompanion
)

type Bookmark

type Bookmark struct {
	gorm.Model
	CardID string `gorm:"index:idx_bookmark_card_id"`
}

type CardPrice

type CardPrice struct {
	ID        uint
	CardID    string
	CreatedAt time.Time
	USD       float64
}

type Deck

type Deck struct {
	ID         string
	Name       string
	CreatedAt  time.Time
	CoverImage string
	DeckType   string
	Commander  *DeckCard

	Sideboard []DeckCard
	Main      []DeckCard
	// contains filtered or unexported fields
}

type DeckCard

type DeckCard struct {
	ID              string
	Count           int
	Card            scryfallcards.Card
	CreatedAt       time.Time
	AssociationType AssociationType
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles the file access for the application

func NewManager

func NewManager(applicationDirectory string, client *goscryfall.Client) *Manager

func (Manager) AddBookmark

func (r Manager) AddBookmark(cardID string) error

func (*Manager) AddCardToDeck

func (m *Manager) AddCardToDeck(deck Deck, cardID, cardName string, count int, association AssociationType) error

func (*Manager) CardSearch

func (m *Manager) CardSearch(sr SearchRequest) ([]scryfallcards.Card, error)

func (*Manager) CopyDeck

func (m *Manager) CopyDeck(d Deck, copyName string) (Deck, error)

func (*Manager) CreateDeck

func (m *Manager) CreateDeck(name, deckType string) (*Deck, error)

func (Manager) FindBookmark

func (r Manager) FindBookmark(cardID string) (*Bookmark, error)

func (Manager) FindByName

func (r Manager) FindByName(name string) ([]scryfallcards.Card, error)

func (Manager) List

func (r Manager) List() ([]Bookmark, error)

func (*Manager) ListBookmarked

func (m *Manager) ListBookmarked() ([]scryfallcards.Card, error)

func (Manager) ListByIds

func (r Manager) ListByIds(ids []string) ([]scryfallcards.Card, error)

func (Manager) ListBySet

func (r Manager) ListBySet(set string) ([]scryfallcards.Card, error)

func (Manager) ListDecks

func (r Manager) ListDecks() ([]Deck, error)

func (Manager) ListSets

func (r Manager) ListSets() ([]scryfallset.Set, error)

func (*Manager) LoadCardImage

func (m *Manager) LoadCardImage(uri string) ([]byte, error)

func (*Manager) LoadDeck

func (m *Manager) LoadDeck(id string) (Deck, error)

func (Manager) LoadPricing

func (r Manager) LoadPricing(cardID string) ([]CardPrice, error)

func (*Manager) LoadRulings

func (m *Manager) LoadRulings(c *scryfallcards.Card) ([]rulings.Ruling, error)

func (*Manager) LoadSetIcon

func (m *Manager) LoadSetIcon(uri string) ([]byte, error)

func (*Manager) LoadSymbolImage

func (m *Manager) LoadSymbolImage(uri string) ([]byte, error)

func (*Manager) ParseDeckDefinition

func (m *Manager) ParseDeckDefinition(deckName, data string) (*decks.Deck, error)

func (Manager) RemoveBookmark

func (r Manager) RemoveBookmark(cardID string) error

func (Manager) RemoveCard

func (r Manager) RemoveCard(c DeckCard) error

func (*Manager) RemoveDeck

func (m *Manager) RemoveDeck(d Deck) error

func (Manager) Search

func (r Manager) Search(sr SearchRequest) ([]scryfallcards.Card, error)

func (Manager) SetCount

func (r Manager) SetCount() int64

func (Manager) Store

func (r Manager) Store(cs []scryfallcards.Card) error

func (Manager) StoreSets

func (r Manager) StoreSets(sets []scryfallset.Set) error

func (Manager) UpdateCover

func (r Manager) UpdateCover(deckID, path string) error

type SearchRequest

type SearchRequest struct {
	Name       string
	TypeLine   string
	OracleText string

	White bool
	Blue  bool
	Black bool
	Red   bool
	Green bool

	StandardLegal        bool
	FutureLegal          bool
	HistoricLegal        bool
	GladiatorLegal       bool
	PioneerLegal         bool
	ExplorerLegal        bool
	ModernLegal          bool
	LegacyLegal          bool
	PauperLegal          bool
	VintageLegal         bool
	PennyLegal           bool
	CommanderLegal       bool
	BrawlLegal           bool
	HistoricBrawlLegal   bool
	AlchemyLegal         bool
	PauperCommanderLegal bool
	DuelLegal            bool
	OldschoolLegal       bool
	PremodernLegal       bool
}

func (SearchRequest) IsEmpty

func (s SearchRequest) IsEmpty() bool

type SetIconRepo

type SetIconRepo interface {
	Image(code string) fyne.Resource
}

type SetIconRepoImpl

type SetIconRepoImpl struct {
}

Jump to

Keyboard shortcuts

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