Help us shape the future of Go! Take the 2026 Go Developer Survey

storage

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearSiteIcon added in v0.10.2

func ClearSiteIcon(siteID uuid.UUID) error

func FetchSiteFavicons added in v0.10.2

func FetchSiteFavicons(ctx context.Context, siteURL string) ([]models.SiteFavicon, error)

func GetImagePath

func GetImagePath(imageDir string, id string) string

func GetSiteIcon

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

func SetSiteIcon added in v0.10.2

func SetSiteIcon(siteID uuid.UUID, dataURL string) 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