Files
schreifuchs.ch/internal/components/images/resorce.go
T
2026-03-02 22:38:28 +01:00

31 lines
500 B
Go

package images
import (
"os"
"github.com/valkey-io/valkey-go"
)
type Options struct {
Width int // max width, 0 is unlimited
Height int // max Height, 0 is unlimited
Quality int // quality of the output jpeg
}
type Service struct {
fs fileSystem
cache valkey.Client
}
func New(fs fileSystem, cache valkey.Client) *Service {
return &Service{
fs: fs,
cache: cache,
}
}
type fileSystem interface {
Read(path string) ([]byte, error)
Stat(path string) (os.FileInfo, error)
}