thumbnail

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 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(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(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(item absto.Item) bool

HasStream checks if given item has a streamable version

func (App) HasThumbnail

func (a App) HasThumbnail(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, items []absto.Item)

List return all thumbnail in a base64 form

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(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