image

package
v0.0.0-...-a602de9 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlurHash

func GetBlurHash(ctx context.Context, url string) (hash string, image image.Image, err error)

func GetFromURL

func GetFromURL(ctx context.Context, url string) (image.Image, error)

Types

type LocalImageStore

type LocalImageStore struct {
	// contains filtered or unexported fields
}

func NewLocalImageStore

func NewLocalImageStore(httpBaseURL string) (*LocalImageStore, error)

func (*LocalImageStore) Dir

func (l *LocalImageStore) Dir() string

func (*LocalImageStore) GetImageURL

func (l *LocalImageStore) GetImageURL(ctx context.Context, id string) (string, error)

func (*LocalImageStore) SaveImage

func (l *LocalImageStore) SaveImage(ctx context.Context, id string, data image.Image) error

type S3Store

type S3Store struct {
	// contains filtered or unexported fields
}

func NewS3Store

func NewS3Store(ctx context.Context, endpoint, region, bucket, keyID, appKey, prefix string) (*S3Store, error)

func (*S3Store) Dir

func (s *S3Store) Dir() string

func (*S3Store) GetImageURL

func (s *S3Store) GetImageURL(ctx context.Context, id string) (string, error)

func (*S3Store) SaveImage

func (s *S3Store) SaveImage(ctx context.Context, id string, data image.Image) error

type Store

type Store interface {
	GetImageURL(ctx context.Context, id string) (string, error)
	SaveImage(ctx context.Context, id string, data image.Image) error
	Dir() string
}

Jump to

Keyboard shortcuts

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