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 ¶
- Constants
- Variables
- func FxModule() fx.Option
- type Art
- 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(category *string) ([]*Art, error)
- func (s *Service) SelectArtsWhoseVariantAbsent(variation string) ([]*Art, error)
- func (s *Service) SelectVariant(id string, kind string) (*Variant, error)
- func (s *Service) SelectVariants(id string) ([]*Variant, error)
- func (s *Service) StoreContent(id string, variation string, content []byte) (err error)
- func (s *Service) TakeContent(id string, variation string) (content []byte, err error)
- func (s *Service) UpsertArts(arts ...*Art) error
- func (s *Service) UpsertVariants(variants ...*Variant) error
- type Variant
Constants ¶
View Source
const ( CategoryImage string = "image" CategoryBackground string = "background" CategoryItem string = "item" CategoryCharacter string = "character" )
View Source
const ( VariationOrigin string = "origin" VariationThumbnail string = "thumbnail" VariationRealEsrgan string = "real-esrgan" )
Variables ¶
View Source
var (
ErrNotFound = errors.New("the resource with the identifier(s) is not found")
)
Functions ¶
Types ¶
type Art ¶
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) 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" json:"artID"` Variation string `gorm:"primaryKey" json:"variation,omitempty"` ContentPresent bool `gorm:"" json:"contentPresent"` ContentWidth *int `gorm:"" json:"contentWidth,omitempty"` ContentHeight *int `gorm:"" json:"contentHeight,omitempty"` }
func NewVariant ¶
Click to show internal directories.
Click to hide internal directories.