Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryThumbnailer ¶
type InMemoryThumbnailer struct{}
InMemoryThumbnailer is for resizing images to thumbnails in memory (doesn't save to temp file, etc).
func NewInMemoryThumbnailer ¶
func NewInMemoryThumbnailer() *InMemoryThumbnailer
NewInMemoryThumbnailer returns a new image thumbnailer.
type S3ThumbnailUploader ¶
type S3ThumbnailUploader struct {
// contains filtered or unexported fields
}
S3ThumbnailUploader is for generating and uploading thumbnails to the remote storage.
func NewS3ThumbnailUploader ¶
func NewS3ThumbnailUploader(s storage.Storage, thumbnailer Thumbnailer) *S3ThumbnailUploader
NewS3ThumbnailUploader creates a new s3 thumbnail uploader.
func (*S3ThumbnailUploader) Generate ¶
func (u *S3ThumbnailUploader) Generate(key string, opts *ThumbnailOptions) ([]*ThumbnailResult, error)
Generate generates thumbnails for the given key stored in S3.
type ThumbnailOptions ¶
type ThumbnailOptions struct { Sizes []*ThumbnailSize // The widths and heights for the thumbnails. NamingStrategy storage.FileNameStrategy // The strategy for generating thumbnail filenames. RemoteDir string // The remote directory to upload the thumbnails. }
ThumbnailOptions defines options for generating thumbnails.
func NewDefaultThumbnailOptions ¶
func NewDefaultThumbnailOptions(remoteDir string, sizes ...*ThumbnailSize) *ThumbnailOptions
NewDefaultThumbnailOptions conveniently creates thumbnail options from the parameters with the crc32 time naming strategy as the default filename strat.
type ThumbnailResult ¶
type ThumbnailResult struct { Pathname string Dimensions *ThumbnailSize }
ThumbnailResult is the resulting thumbnail generated.
type ThumbnailSize ¶
ThumbnailSize defines the width and height of the thumbnails.
func NewThumbnailSize ¶
func NewThumbnailSize(width, height int) *ThumbnailSize
NewThumbnailSize creates a new thumbnail size for the given width and height.
type ThumbnailUploader ¶
type ThumbnailUploader interface {
Generate(key string, opts *ThumbnailOptions) ([]*ThumbnailResult, error)
}
ThumbnailUploader is for uploading generating and uploading thumbnails.
type Thumbnailer ¶
Thumbnailer is the interface for generating thumbnails.