Documentation ¶
Overview ¶
Package art provides functionalities related to Art and Variant of the game, including serving them, manipulating them and keep them persisted.
This package exposes its main interfaces by fx via FxModule function. However, it is still easy to instantiate an art.Service by simply creating it.
Index ¶
- Variables
- func FxModule() fx.Option
- type Art
- type Category
- type Content
- type ContentParams
- type Service
- func (s *Service) Authenticate(uuid uuid.UUID) *infra.User
- func (s *Service) SelectArt(id string) (*Art, error)
- func (s *Service) SelectArts() ([]*Art, error)
- func (s *Service) SelectArtsByCategory(category Category) ([]*Art, error)
- func (s *Service) SelectArtsByIDLike(like string) ([]*Art, error)
- func (s *Service) SelectArtsByIDs(ids []string) ([]*Art, error)
- func (s *Service) SelectArtsWhoseVariantAbsent(variation Variation) ([]*Art, error)
- func (s *Service) SelectVariant(id string, variation Variation) (*Variant, error)
- func (s *Service) SelectVariants(id string) ([]*Variant, error)
- func (s *Service) StoreContent(id string, variation Variation, content []byte) (err error)
- func (s *Service) TakeContent(id string, variation Variation) (content []byte, err error)
- func (s *Service) UpsertArts(arts ...*Art) error
- func (s *Service) UpsertVariants(variants ...*Variant) error
- type Variant
- type Variation
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("the resource with the identifier(s) is not found")
)
Functions ¶
Types ¶
type Art ¶
type Category ¶ added in v1.4.0
type Category string
func MustParseCategory ¶ added in v1.4.0
func ParseCategory ¶ added in v1.4.0
func (*Category) UnmarshalJSON ¶ added in v1.4.0
type Content ¶ added in v1.0.7
Content helps store and take the content of a variant to or from the filesystem.
type ContentParams ¶ added in v1.0.7
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Authenticate ¶ added in v1.1.0
func (*Service) SelectArts ¶
func (*Service) SelectArtsByCategory ¶ added in v1.4.0
func (*Service) SelectArtsByIDLike ¶ added in v1.7.0
func (*Service) SelectArtsByIDs ¶ added in v1.2.0
func (*Service) SelectArtsWhoseVariantAbsent ¶
func (*Service) SelectVariant ¶
func (*Service) StoreContent ¶ added in v1.0.7
func (*Service) TakeContent ¶ added in v1.0.7
func (*Service) UpsertArts ¶
func (*Service) UpsertVariants ¶
type Variant ¶
type Variant struct { ArtID string `gorm:"primaryKey;type:text COLLATE numeric;check:art_id=lower(art_id)" json:"artID"` Variation Variation `gorm:"primaryKey;type:art_variation" json:"variation,omitempty"` ContentPresent bool `gorm:"" json:"contentPresent"` ContentWidth *int `gorm:"" json:"contentWidth,omitempty"` ContentHeight *int `gorm:"" json:"contentHeight,omitempty"` }
func NewVariant ¶
type Variation ¶ added in v1.4.0
type Variation string
func ParseVariation ¶ added in v1.4.0
func (*Variation) UnmarshalJSON ¶ added in v1.4.0
Click to show internal directories.
Click to hide internal directories.