Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
FileSystem represents a storage for the thumbnails using the local file system.
func NewFileSystemStorage ¶
func NewFileSystemStorage(cfg config.FileSystemStorage, logger log.Logger) *FileSystem
NewFileSystemStorage creates a new instanz of FileSystem
func (*FileSystem) BuildKey ¶
func (s *FileSystem) BuildKey(r Request) string
BuildKey generate the unique key for a thumbnail. The key is structure as follows:
<first two letters of etag>/<next two letters of etag>/<rest of etag>/<width>x<height>.<filetype>
e.g. 97/9f/4c8db98f7b82e768ef478d3c8612/500x300.png
The key also represents the path to the thumbnail in the filesystem under the configured root directory.
type InMemory ¶
type InMemory struct {
// contains filtered or unexported fields
}
InMemory represents an in memory storage for thumbnails Can be used during development
func NewInMemoryStorage ¶
func NewInMemoryStorage() InMemory
NewInMemoryStorage creates a new InMemory instance.
type Request ¶
type Request struct { ETag string Types []string Resolution resolution.Resolution }
Request combines different attributes needed for storage operations.