res

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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, resTypeStr 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, resTypeStr string) error

func (*Controller) GetImages

func (c *Controller) GetImages(ctx *fiber.Ctx) error

type Resource

type Resource struct {
	Name string
	Path string
}

type ResourceType

type ResourceType string
const (
	Raw       ResourceType = "raw"
	Thumbnail ResourceType = "thumbnail"
)

func ResTypeFromString

func ResTypeFromString(str string) (ResourceType, error)

func (ResourceType) FileName

func (r ResourceType) FileName(base string) string

func (ResourceType) Location

func (r ResourceType) Location(baseLocation string, resVersion string) string

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 (s *Service) GetBackgroundByName(ctx context.Context, name string, resType ResourceType) (*Resource, error)

func (*Service) GetBackgrounds

func (s *Service) GetBackgrounds(ctx context.Context) ([]Resource, error)

func (*Service) GetImageByName

func (s *Service) GetImageByName(ctx context.Context, name string, resType ResourceType) (*Resource, error)

func (*Service) GetImages

func (s *Service) GetImages(ctx context.Context) ([]Resource, error)

Jump to

Keyboard shortcuts

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