postgres

package
v0.0.0-...-3040c09 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: GPL-3.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 Deck

type Deck struct {
	ID uuid.UUID `gorm:"primaryKey;type:uuid;default:gen_random_uuid ()"`

	Shuffled  bool
	Remaining int
	Cards     pq.StringArray `gorm:"type:text[]"`

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt
}

type DeckPostgresRepo

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

func NewDeckPostgresRepo

func NewDeckPostgresRepo(ctx context.Context, dsn string, log *log.Logger) (*DeckPostgresRepo, error)

func (*DeckPostgresRepo) CreateDeck

func (r *DeckPostgresRepo) CreateDeck(ctx context.Context, deck *entities.Deck) (*entities.Deck, error)

func (*DeckPostgresRepo) DrawDeckCard

func (r *DeckPostgresRepo) DrawDeckCard(ctx context.Context, id uuid.UUID, count int64) ([]*entities.Card, error)

func (*DeckPostgresRepo) Migrate

func (r *DeckPostgresRepo) Migrate() error

func (*DeckPostgresRepo) ReadDeck

func (r *DeckPostgresRepo) ReadDeck(ctx context.Context, id uuid.UUID) (*entities.Deck, error)

Jump to

Keyboard shortcuts

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