Documentation ¶
Overview ¶
Package preview implements business logic.
Index ¶
- type Preview
- func (p Preview) AddItemIntoCache(item entities.CacheItem) (bool, error)
- func (p Preview) CalcHash(url string) (string, error)
- func (p Preview) Close() error
- func (p Preview) IsItemInCache(hash string) (entities.CacheItem, bool, error)
- func (p Preview) Preview(width, height int, img image.Image, opts entities.ResizeOptions) image.Image
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Preview ¶
type Preview struct { Previewer preview.Previewer ImageURLEncoder encode.Hasher Cacher cache.Cacher Storager storage.Storager }
Preview is the main Preview struct.
func NewPreview ¶
func NewPreview(prevImpl preview.Previewer, encImpl encode.Hasher, cacheImpl cache.Cacher, storImpl storage.Storager, ) (*Preview, error)
NewPreview inits main Preview fields.
func (Preview) AddItemIntoCache ¶
AddItemIntoCache adds image into cache.
func (Preview) IsItemInCache ¶
IsItemInCache returns image if it in the cache.
Click to show internal directories.
Click to hide internal directories.