imagestore

package
v0.0.0-...-6df7ce4 Latest Latest
Warning

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

Go to latest
Published: May 12, 2015 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

func NewFactory

func NewFactory(conf *config.Configuration) *Factory

func (*Factory) NewGCSImageStore

func (this *Factory) NewGCSImageStore(conf map[string]string) ImageStore

func (*Factory) NewHashGenerator

func (this *Factory) NewHashGenerator(store ImageStore) *HashGenerator

func (*Factory) NewImageStores

func (this *Factory) NewImageStores() []ImageStore

func (*Factory) NewLocalImageStore

func (this *Factory) NewLocalImageStore(conf map[string]string) ImageStore

func (*Factory) NewS3ImageStore

func (this *Factory) NewS3ImageStore(conf map[string]string) ImageStore

func (*Factory) NewStoreObject

func (this *Factory) NewStoreObject(name string, mime string, imgType string) *StoreObject

type GCSImageStore

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

func NewGCSImageStore

func NewGCSImageStore(ctx context.Context, bucket string, root string, mapper *NamePathMapper) *GCSImageStore

func (*GCSImageStore) Exists

func (this *GCSImageStore) Exists(obj *StoreObject) (bool, error)

func (*GCSImageStore) Save

func (this *GCSImageStore) Save(src string, obj *StoreObject) (*StoreObject, error)

type HashGenerator

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

func (*HashGenerator) Get

func (this *HashGenerator) Get() string

type ImageStore

type ImageStore interface {
	Save(src string, obj *StoreObject) (*StoreObject, error)
	Exists(obj *StoreObject) (bool, error)
}

type ImageStores

type ImageStores []ImageStore

func (*ImageStores) Exists

func (this *ImageStores) Exists(obj *StoreObject) (bool, error)

func (*ImageStores) Save

func (this *ImageStores) Save(src string, obj *StoreObject)

type LocalImageStore

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

func NewLocalImageStore

func NewLocalImageStore(root string, mapper *NamePathMapper) *LocalImageStore

func (*LocalImageStore) Exists

func (this *LocalImageStore) Exists(obj *StoreObject) (bool, error)

func (*LocalImageStore) Save

func (this *LocalImageStore) Save(src string, obj *StoreObject) (*StoreObject, error)

type NamePathMapper

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

func NewNamePathMapper

func NewNamePathMapper(expr string, mapping string) *NamePathMapper

type S3ImageStore

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

func NewS3ImageStore

func NewS3ImageStore(bucket string, root string, client *s3.S3, mapper *NamePathMapper) *S3ImageStore

func (*S3ImageStore) Exists

func (this *S3ImageStore) Exists(obj *StoreObject) (bool, error)

func (*S3ImageStore) Save

func (this *S3ImageStore) Save(src string, obj *StoreObject) (*StoreObject, error)

type StoreObject

type StoreObject struct {
	Name     string // Unique identifier
	MimeType string // i.e. image/jpg
	Type     string // i.e. thumb
	Url      string // if publicly available
}

Jump to

Keyboard shortcuts

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