app

package
v0.0.0-...-68bd8a1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardsRepository

type CardsRepository interface {
	Insert(ctx context.Context, card domain.Card) error
	Update(ctx context.Context, card domain.Card) error
	GetByID(ctx context.Context, id uuid.UUID) (domain.Card, error)
	GetAll(ctx context.Context) ([]domain.Card, error)
}

type Command

type Command interface {
	Name() string
}

Command defines the interface of the commands to be performed

type CommandHandler

type CommandHandler interface {
	Handle(ctx context.Context, cmd Command) error
}

CommandHandler defines the interface of the handler to run commands

type CreateCardCmd

type CreateCardCmd struct {
	ID            uuid.UUID
	CardName      string
	CardLanguage  string
	CardURL       string
	CardSetName   string
	CardRarity    string
	CardImage     string
	CardManaCost  string
	CardReprint   bool
	CardPrice     string
	CardReleaseAt time.Time
	CardOpts      []domain.Opt
	CardQuantity  int
	CardCondition domain.Condition
}

CreateCardCmd is a VTO

func (CreateCardCmd) Name

func (c CreateCardCmd) Name() string

Name returns the name of the command to create a card

type CreateCardHandler

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

CreateCardHandler is the handler to create a card

func NewCreateCardHandler

func NewCreateCardHandler(repository CardsRepository) CreateCardHandler

NewCreateCardHandler is a constructor

func (CreateCardHandler) Handle

func (c CreateCardHandler) Handle(ctx context.Context, cmd Command) error

Handle creates a canvas

type InvalidCommandError

type InvalidCommandError struct {
	Received Command
	Expected Command
}

func (InvalidCommandError) Error

func (ice InvalidCommandError) Error() string

Jump to

Keyboard shortcuts

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