Documentation ¶
Index ¶
- func RegisterController(v0 *server.V0, c Controller)
- type Controller
- type Resource
- type Service
- func (s *Service) GetBackgroundByName(ctx context.Context, name string, variant Variant) (*Resource, error)
- func (s *Service) GetBackgrounds(ctx context.Context) ([]Resource, error)
- func (s *Service) GetImageByName(ctx context.Context, name string, variant Variant) (*Resource, error)
- func (s *Service) GetImages(ctx context.Context) ([]Resource, error)
- type Variant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterController ¶
func RegisterController(v0 *server.V0, c Controller)
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(service *Service) Controller
func (*Controller) GetBackgroundByName ¶
func (c *Controller) GetBackgroundByName(ctx *fiber.Ctx, name string, variantStr string) error
func (*Controller) GetBackgrounds ¶
func (c *Controller) GetBackgrounds(ctx *fiber.Ctx) error
func (*Controller) GetImageByName ¶
func (c *Controller) GetImageByName(ctx *fiber.Ctx, name string, variantStr string) error
func (*Controller) GetImages ¶
func (c *Controller) GetImages(ctx *fiber.Ctx) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(conf *config.Config, repo *avg.VersionRepo) *Service
func (*Service) GetBackgroundByName ¶
func (*Service) GetBackgrounds ¶
func (*Service) GetImageByName ¶
type Variant ¶ added in v0.5.0
type Variant struct { Key string FileName func(base string) string Location func(base string, version string) string }
var ( Raw Variant = Variant{ Key: "raw", FileName: func(base string) string { return fmt.Sprintf("%s.png", base) }, Location: func(base string, version string) string { return filepath.Join(base, version, "raw") }, } Thumbnail Variant = Variant{ Key: "raw", FileName: func(base string) string { return fmt.Sprintf("%s.webp", base) }, Location: func(base string, version string) string { return filepath.Join(base, version, "thumbnail") }, } )
func VariantFromString ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.