Documentation
¶
Index ¶
- func EntityArtworkToFeedItems(ctx fiber.Ctx, cfg runtimecfg.RestConfig, arts []*entity.Artwork) []*feeds.Item
- func PictureResponseUrl(ctx fiber.Ctx, pic *entity.Picture, cfg runtimecfg.RestConfig) (thumbnail, regular string)
- func ResponseUrlForStoragePath(ctx fiber.Ctx, detail shared.StorageDetail, rules []runtimecfg.StoragePathRule) string
- func StatusMessage(status int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EntityArtworkToFeedItems ¶
func EntityArtworkToFeedItems( ctx fiber.Ctx, cfg runtimecfg.RestConfig, arts []*entity.Artwork) []*feeds.Item
func PictureResponseUrl ¶
func PictureResponseUrl(ctx fiber.Ctx, pic *entity.Picture, cfg runtimecfg.RestConfig) (thumbnail, regular string)
根据配置生成图片的访问 URL
返回值一定不为空, 无可用配置时会回落到 pic.Thumbnail
func ResponseUrlForStoragePath ¶
func ResponseUrlForStoragePath(ctx fiber.Ctx, detail shared.StorageDetail, rules []runtimecfg.StoragePathRule) string
在api返回中重写存储路径, 用于拼接直链
例: rule.Type = "alist", rule.Path = "/pictures/", rule.JoinPrefix = "https://example.com/pictures/", rule.TrimPrefix = "/pictures/"
-> https://example.com/pictures/1234567890abcdef.jpg
如果图片路径以rule.Path开头, 且rule.StorageType为空或与图片存储类型匹配, 则将图片路径转换为rule.JoinPrefix + 图片路径去掉rule.TrimPrefix的部分
否则空
func StatusMessage ¶
StatusMessage returns the correct message for the provided HTTP statuscode
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.