service

package
v0.0.0-...-fae07df Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Extensions = map[string]string{
	"image/jpeg": "jpg",
	"image/png":  "png",
	"image/bmp":  "bmp",
	"image/gif":  "gif",
}

Functions

This section is empty.

Types

type Storage

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

Storage service

func New

func New(fs storage.Storage, db *store.Store) (*Storage, error)

New return a new service instance

func (*Storage) Display

func (s *Storage) Display(sha string, opt *engine.ImageOptions) (image.Image, error)

Display a image, resampled images are not stored on disk and are generated on the fly. we can cache these images in a proxy

func (*Storage) Find

func (s *Storage) Find(sha string) (storage.File, *metadata.Metadata, error)

Find a file

func (*Storage) PathForCached

func (s *Storage) PathForCached(sha string, opt *engine.ImageOptions) string

func (*Storage) PathForSHA

func (s *Storage) PathForSHA(sha string) string

func (*Storage) Save

func (s *Storage) Save(f storage.File, m *metadata.Metadata) error

Save a file

Jump to

Keyboard shortcuts

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