asset

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Img      = Variant("img")
	Timg     = Variant("timg")
	Variants = map[string]Variant{
		"img":  Img,
		"timg": Timg,
	}
	VariantExts = map[Variant]string{
		Img:  ".webp",
		Timg: ".webp",
	}
)
View Source
var (
	Image       = Kind("images")
	Backgrounds = Kind("backgrounds")
	Kinds       = map[string]Kind{
		"images":      Image,
		"backgrounds": Backgrounds,
	}
)

Functions

func RegisterController

func RegisterController(v0 *server.V0, c Controller)

Types

type Asset

type Asset struct {
	ID   string `json:"id"`
	Kind Kind   `json:"kind"`
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(service *Service) Controller

func (*Controller) GetAssetsByID

func (c *Controller) GetAssetsByID(ctx *fiber.Ctx, variantStr string, kindStr string, id string) error

func (*Controller) GetAssetsByV

func (c *Controller) GetAssetsByV(ctx *fiber.Ctx, variantStr string) error

func (*Controller) GetAssetsByVK

func (c *Controller) GetAssetsByVK(ctx *fiber.Ctx, variantStr string, kindStr string) error

type Kind

type Kind string

func ParseKind

func ParseKind(str string) (Kind, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(conf *config.Config, repo *avg.VersionRepo) *Service

func (*Service) GetAssetByID

func (s *Service) GetAssetByID(id string, variant Variant, kind Kind) (string, error)

func (*Service) GetAssets

func (s *Service) GetAssets(variant Variant, kind *Kind) ([]Asset, error)

type Variant

type Variant string

func ParseVariant

func ParseVariant(str string) (Variant, error)

Jump to

Keyboard shortcuts

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