deck

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDeckNotFound          = errors.New("Deck not found")
	ErrCardCountNotAvailable = errors.New("Can't draw more cards than available on the deck")
	ErrInvalidCardCode       = errors.New("Some of cards has an invalid code")
	ErrInvalidDeckSize       = errors.New("The amount of cards is greater than it should be")
	ErrInvalidDeckID         = errors.New("Invalid Deck ID")
)

Functions

This section is empty.

Types

type CardResponse

type CardResponse struct {
	Value string `json:"value"`
	Suit  string `json:"suit"`
	Code  string `json:"code"`
}

type CreateDeckResponse

type CreateDeckResponse struct {
	ID        uuid.UUID `json:"deck_id"`
	Shuffled  bool      `json:"shuffled"`
	Remaining int       `json:"remaining"`
}

type DrawCardResponse

type DrawCardResponse struct {
	Cards []*CardResponse `json:"cards"`
}

type OpenDeckResponse

type OpenDeckResponse struct {
	ID        uuid.UUID       `json:"deck_id"`
	Shuffled  bool            `json:"shuffled"`
	Remaining int             `json:"remaining"`
	Cards     []*CardResponse `json:"cards,omitempty"`
}

Jump to

Keyboard shortcuts

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