cardset

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardBlock

type CardBlock struct {
	Id    sql.NullInt64
	Block string
}

type CardSet

type CardSet struct {
	Code         string
	Name         string
	TotalCount   int
	Released     time.Time
	Block        CardBlock
	Type         string
	Translations []Translation
}

func (CardSet) Diff added in v0.2.0

func (s CardSet) Diff(other *CardSet) *api.Changeset

type PostgresSetDao

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

func NewDao

func (*PostgresSetDao) Count

func (d *PostgresSetDao) Count() (int, error)

func (*PostgresSetDao) CreateBlock

func (d *PostgresSetDao) CreateBlock(block string) (*CardBlock, error)

func (*PostgresSetDao) CreateCardSet

func (d *PostgresSetDao) CreateCardSet(set *CardSet) error

func (*PostgresSetDao) CreateTranslation

func (d *PostgresSetDao) CreateTranslation(setCode string, t *Translation) error

func (*PostgresSetDao) DeleteTranslation

func (d *PostgresSetDao) DeleteTranslation(setCode string, lang string) error

func (*PostgresSetDao) FindBlockByName

func (d *PostgresSetDao) FindBlockByName(blockName string) (*CardBlock, error)

func (*PostgresSetDao) FindCardSetByCode

func (d *PostgresSetDao) FindCardSetByCode(code string) (*CardSet, error)

func (*PostgresSetDao) FindTranslations

func (d *PostgresSetDao) FindTranslations(setCode string) ([]*Translation, error)

func (*PostgresSetDao) UpdateCardSet

func (d *PostgresSetDao) UpdateCardSet(set *CardSet) error

func (*PostgresSetDao) UpdateTranslation

func (d *PostgresSetDao) UpdateTranslation(setCode string, t *Translation) error

type Service

type Service interface {
	Import(set *CardSet) error
	Count() (int, error)
}

func NewService

func NewService(dao *PostgresSetDao) Service

type Translation

type Translation struct {
	Name string
	Lang string
}

Jump to

Keyboard shortcuts

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