repository

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardRepository

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

func NewCardRepository

func NewCardRepository(cfg *config.Config, db *db.DB) *CardRepository

func (*CardRepository) Create

func (s *CardRepository) Create(gameID, collectionID, deckID string, dtoObject *dto.CreateCardDTO) (*entity.CardInfo, error)

func (*CardRepository) DeleteByID

func (s *CardRepository) DeleteByID(gameID, collectionID, deckID string, cardID int64) error

func (*CardRepository) GetAll

func (s *CardRepository) GetAll(gameID, collectionID, deckID string) ([]*entity.CardInfo, error)

func (*CardRepository) GetByID

func (s *CardRepository) GetByID(gameID, collectionID, deckID string, cardID int64) (*entity.CardInfo, error)

func (*CardRepository) GetImage

func (s *CardRepository) GetImage(gameID, collectionID, deckID string, cardID int64) ([]byte, string, error)

func (*CardRepository) Update

func (s *CardRepository) Update(gameID, collectionID, deckID string, cardID int64, dtoObject *dto.UpdateCardDTO) (*entity.CardInfo, error)

type CollectionRepository

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

func NewCollectionRepository

func NewCollectionRepository(cfg *config.Config, db *db.DB) *CollectionRepository

func (*CollectionRepository) Create

func (s *CollectionRepository) Create(gameID string, dtoObject *dto.CreateCollectionDTO) (*entity.CollectionInfo, error)

func (*CollectionRepository) DeleteByID

func (s *CollectionRepository) DeleteByID(gameID, collectionID string) error

func (*CollectionRepository) GetAll

func (s *CollectionRepository) GetAll(gameID string) ([]*entity.CollectionInfo, error)

func (*CollectionRepository) GetByID

func (s *CollectionRepository) GetByID(gameID, collectionID string) (*entity.CollectionInfo, error)

func (*CollectionRepository) GetImage

func (s *CollectionRepository) GetImage(gameID, collectionID string) ([]byte, string, error)

func (*CollectionRepository) Update

func (s *CollectionRepository) Update(gameID, collectionID string, dtoObject *dto.UpdateCollectionDTO) (*entity.CollectionInfo, error)

type DeckRepository

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

func NewDeckRepository

func NewDeckRepository(cfg *config.Config, db *db.DB) *DeckRepository

func (*DeckRepository) Create

func (s *DeckRepository) Create(gameID, collectionID string, dtoObject *dto.CreateDeckDTO) (*entity.DeckInfo, error)

func (*DeckRepository) DeleteByID

func (s *DeckRepository) DeleteByID(gameID, collectionID, deckID string) error

func (*DeckRepository) GetAll

func (s *DeckRepository) GetAll(gameID, collectionID string) ([]*entity.DeckInfo, error)

func (*DeckRepository) GetAllDecksInGame

func (s *DeckRepository) GetAllDecksInGame(gameID string) ([]*entity.DeckInfo, error)

func (*DeckRepository) GetByID

func (s *DeckRepository) GetByID(gameID, collectionID, deckID string) (*entity.DeckInfo, error)

func (*DeckRepository) GetImage

func (s *DeckRepository) GetImage(gameID, collectionID, deckID string) ([]byte, string, error)

func (*DeckRepository) Update

func (s *DeckRepository) Update(gameID, collectionID, deckID string, dtoObject *dto.UpdateDeckDTO) (*entity.DeckInfo, error)

type GameRepository

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

func NewGameRepository

func NewGameRepository(cfg *config.Config, db *db.DB) *GameRepository

func (*GameRepository) Create

func (s *GameRepository) Create(dtoObject *dto.CreateGameDTO) (*entity.GameInfo, error)

func (*GameRepository) DeleteByID

func (s *GameRepository) DeleteByID(gameID string) error

func (*GameRepository) Duplicate

func (s *GameRepository) Duplicate(gameID string, dtoObject *dto.DuplicateGameDTO) (*entity.GameInfo, error)

func (*GameRepository) Export

func (s *GameRepository) Export(gameID string) ([]byte, error)

func (*GameRepository) GetAll

func (s *GameRepository) GetAll() ([]*entity.GameInfo, error)

func (*GameRepository) GetByID

func (s *GameRepository) GetByID(gameID string) (*entity.GameInfo, error)

func (*GameRepository) GetImage

func (s *GameRepository) GetImage(gameID string) ([]byte, string, error)

func (*GameRepository) Import

func (s *GameRepository) Import(data []byte, name string) (*entity.GameInfo, error)

func (*GameRepository) Update

func (s *GameRepository) Update(gameID string, dtoObject *dto.UpdateGameDTO) (*entity.GameInfo, error)

type ICardRepository

type ICardRepository interface {
	Create(gameID, collectionID, deckID string, req *dto.CreateCardDTO) (*entity.CardInfo, error)
	GetByID(gameID, collectionID, deckID string, cardID int64) (*entity.CardInfo, error)
	GetAll(gameID, collectionID, deckID string) ([]*entity.CardInfo, error)
	Update(gameID, collectionID, deckID string, cardID int64, dtoObject *dto.UpdateCardDTO) (*entity.CardInfo, error)
	DeleteByID(gameID, collectionID, deckID string, cardID int64) error
	GetImage(gameID, collectionID, deckID string, cardID int64) ([]byte, string, error)
}

type ICollectionRepository

type ICollectionRepository interface {
	Create(gameID string, req *dto.CreateCollectionDTO) (*entity.CollectionInfo, error)
	GetByID(gameID, collectionID string) (*entity.CollectionInfo, error)
	GetAll(gameID string) ([]*entity.CollectionInfo, error)
	Update(gameID, collectionID string, dtoObject *dto.UpdateCollectionDTO) (*entity.CollectionInfo, error)
	DeleteByID(gameID, collectionID string) error
	GetImage(gameID, collectionID string) ([]byte, string, error)
}

type IDeckRepository

type IDeckRepository interface {
	Create(gameID, collectionID string, req *dto.CreateDeckDTO) (*entity.DeckInfo, error)
	GetByID(gameID, collectionID, deckID string) (*entity.DeckInfo, error)
	GetAll(gameID, collectionID string) ([]*entity.DeckInfo, error)
	Update(gameID, collectionID, deckID string, dtoObject *dto.UpdateDeckDTO) (*entity.DeckInfo, error)
	DeleteByID(gameID, collectionID, deckID string) error
	GetImage(gameID, collectionID, deckID string) ([]byte, string, error)
	GetAllDecksInGame(gameID string) ([]*entity.DeckInfo, error)
}

type IGameRepository

type IGameRepository interface {
	Create(req *dto.CreateGameDTO) (*entity.GameInfo, error)
	GetByID(gameID string) (*entity.GameInfo, error)
	GetAll() ([]*entity.GameInfo, error)
	Update(gameID string, dtoObject *dto.UpdateGameDTO) (*entity.GameInfo, error)
	DeleteByID(gameID string) error
	GetImage(gameID string) ([]byte, string, error)
	Duplicate(gameID string, dtoObject *dto.DuplicateGameDTO) (*entity.GameInfo, error)
	Export(gameID string) ([]byte, error)
	Import(data []byte, name string) (*entity.GameInfo, error)
}

type ISystemRepository

type ISystemRepository interface {
	GetSettings() (*entity.SettingInfo, error)
	SaveSettings(set *entity.SettingInfo) error
}

type SystemRepository

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

func NewSystemRepository

func NewSystemRepository(cfg *config.Config, db *db.DB) *SystemRepository

func (*SystemRepository) GetSettings

func (s *SystemRepository) GetSettings() (*entity.SettingInfo, error)

func (*SystemRepository) SaveSettings

func (s *SystemRepository) SaveSettings(set *entity.SettingInfo) error

Jump to

Keyboard shortcuts

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