thumbnail

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const SmallSize uint64 = 150

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VithURL  string
	VithUser string
	VithPass string

	AmqpExchange            string
	AmqpStreamRoutingKey    string
	AmqpThumbnailRoutingKey string

	MaxSize      int64
	MinBitrate   uint64
	DirectAccess bool

	LargeSize uint64
}

func Flags

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

type Service added in v0.26.0

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

func New

func New(ctx context.Context, config *Config, storage absto.Storage, redisClient redis.Client, meterProvider metric.MeterProvider, traceProvider trace.TracerProvider, amqpClient *amqp.Client) (Service, error)

func (Service) AMQPHandler added in v0.26.0

func (s Service) AMQPHandler(ctx context.Context, message amqp.Delivery) (err error)

func (Service) CanHaveThumbnail added in v0.26.0

func (s Service) CanHaveThumbnail(item absto.Item) bool

func (Service) EventConsumer added in v0.26.0

func (s Service) EventConsumer(ctx context.Context, e provider.Event)

func (Service) GetChunk added in v0.26.0

func (s Service) GetChunk(ctx context.Context, pathname string) (absto.Item, error)

func (Service) HasLargeThumbnail added in v0.26.0

func (s Service) HasLargeThumbnail(ctx context.Context, item absto.Item) bool

func (Service) HasStream added in v0.26.0

func (s Service) HasStream(ctx context.Context, item absto.Item) bool

func (Service) HasThumbnail added in v0.26.0

func (s Service) HasThumbnail(ctx context.Context, item absto.Item, scale uint64) bool

func (Service) Info added in v0.26.0

func (s Service) Info(ctx context.Context, pathname string) (item absto.Item, err error)

func (Service) LargeThumbnailSize added in v0.26.0

func (s Service) LargeThumbnailSize() uint64

func (Service) List added in v0.26.0

func (s Service) List(w http.ResponseWriter, r *http.Request, item absto.Item, items []absto.Item)

func (Service) ListDir added in v0.26.0

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

func (Service) ListDirLarge added in v0.26.0

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

func (Service) Path added in v0.26.0

func (s Service) Path(item absto.Item) string

func (Service) PathForLarge added in v0.26.0

func (s Service) PathForLarge(item absto.Item) string

func (Service) PathForScale added in v0.26.0

func (s Service) PathForScale(item absto.Item, scale uint64) string

func (Service) Rename added in v0.26.0

func (s Service) Rename(ctx context.Context, old, new absto.Item) error

func (Service) Serve added in v0.26.0

func (s Service) Serve(w http.ResponseWriter, r *http.Request, item absto.Item)

func (Service) Stream added in v0.26.0

func (s Service) Stream(w http.ResponseWriter, r *http.Request, item absto.Item)

Jump to

Keyboard shortcuts

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