thumbnail

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 31 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
}

func New

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

func (App) AMQPHandler added in v0.23.0

func (a App) AMQPHandler(ctx context.Context, message amqp.Delivery) error

func (App) CanHaveThumbnail added in v0.9.0

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

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)

func (App) HasLargeThumbnail added in v0.17.0

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

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

func (App) Info added in v0.23.0

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

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

func (App) PathForLarge added in v0.18.0

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

func (App) PathForScale added in v0.18.0

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

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

type Config

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

func Flags

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

Jump to

Keyboard shortcuts

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