storage

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImagePath

func GetImagePath(imageDir string, checksum string) string

func GetSiteIcon

func GetSiteIcon(ctx context.Context, site models.Site) ([]byte, error)

Types

type Backend

type Backend interface {
	WriteFile(file []byte, image *models.Image) error
	DestroyFile(image *models.Image) error
	ReadFile(image models.Image) (io.ReadCloser, int64, error)
}

func Image

func Image() Backend

type FileBackend

type FileBackend struct{}

func (*FileBackend) DestroyFile

func (s *FileBackend) DestroyFile(image *models.Image) error

func (*FileBackend) ReadFile

func (s *FileBackend) ReadFile(image models.Image) (io.ReadCloser, int64, error)

func (*FileBackend) WriteFile

func (s *FileBackend) WriteFile(file []byte, image *models.Image) error

type S3Backend

type S3Backend struct{}

func (*S3Backend) DestroyFile

func (s *S3Backend) DestroyFile(image *models.Image) error

func (*S3Backend) ReadFile

func (s *S3Backend) ReadFile(image models.Image) (io.ReadCloser, int64, error)

func (*S3Backend) WriteFile

func (s *S3Backend) WriteFile(file []byte, image *models.Image) error

Jump to

Keyboard shortcuts

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