thumbnail

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SmallSize is the square size of each thumbnail generated
	SmallSize uint64 = 150
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App of package

func New

func New(config Config, storage absto.Storage, prometheusRegisterer prometheus.Registerer, amqpClient *amqp.Client) (App, error)

New creates new App from Config

func (App) CanHaveThumbnail added in v0.9.0

func (a App) CanHaveThumbnail(item absto.Item) bool

CanHaveThumbnail determine if thumbnail can be generated for given pathname

func (App) EventConsumer added in v0.7.0

func (a App) EventConsumer(ctx context.Context, e provider.Event)

EventConsumer handle event pushed to the event bus

func (App) GetChunk added in v0.9.0

func (a App) GetChunk(ctx context.Context, pathname string) (absto.Item, error)

GetChunk retrieve the storage item in the metadata

func (App) HasLargeThumbnail added in v0.17.0

func (a App) HasLargeThumbnail(ctx context.Context, item absto.Item) bool

HasLargeThumbnail determine if large thumbnail exist for given pathname

func (App) HasStream added in v0.9.0

func (a App) HasStream(ctx context.Context, item absto.Item) bool

HasStream checks if given item has a streamable version

func (App) HasThumbnail

func (a App) HasThumbnail(ctx context.Context, item absto.Item, scale uint64) bool

HasThumbnail determine if thumbnail exist for given pathname

func (App) LargeThumbnailSize added in v0.17.0

func (a App) LargeThumbnailSize() uint64

LargeThumbnailSize give large thumbnail size

func (App) List

func (a App) List(w http.ResponseWriter, r *http.Request, request provider.Request, item absto.Item, items []absto.Item)

List return all thumbnails in a base64 form

func (App) ListDir added in v0.18.0

func (a App) ListDir(ctx context.Context, item absto.Item) (map[string]absto.Item, error)

ListDir return all thumbnails for a given directory

func (App) ListDirLarge added in v0.18.0

func (a App) ListDirLarge(ctx context.Context, item absto.Item) (map[string]absto.Item, error)

ListDirLarge return all thumbnails for large size for a given directory

func (App) Path added in v0.18.0

func (a App) Path(item absto.Item) string

Path computes thumbnail path for a a given item

func (App) PathForLarge added in v0.18.0

func (a App) PathForLarge(item absto.Item) string

PathForLarge computes thumbnail path for a a given item and large size

func (App) PathForScale added in v0.18.0

func (a App) PathForScale(item absto.Item, scale uint64) string

PathForScale computes thumbnail path for a a given item and scale

func (App) Rename

func (a App) Rename(ctx context.Context, old, new absto.Item) error

Rename thumbnail of an item

func (App) Serve

func (a App) Serve(w http.ResponseWriter, r *http.Request, item absto.Item)

Serve check if thumbnail is present and serve it

func (App) Stream added in v0.9.0

func (a App) Stream(w http.ResponseWriter, r *http.Request, item absto.Item)

Stream check if stream is present and serve it

func (App) ThumbnailInfo added in v0.16.0

func (a App) ThumbnailInfo(ctx context.Context, item absto.Item, scale uint64) (thumbnailItem absto.Item, ok bool)

ThumbnailInfo determine if thumbnail exist for given pathname and provide detail about it

type Config

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

Config of package

func Flags

func Flags(fs *flag.FlagSet, prefix string) Config

Flags adds flags for configuring package

Jump to

Keyboard shortcuts

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