util

package
v0.0.0-...-0305fab Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2015 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByDateTime

type ByDateTime []Photo

func (ByDateTime) Len

func (a ByDateTime) Len() int

func (ByDateTime) Less

func (a ByDateTime) Less(i, j int) bool

func (ByDateTime) Swap

func (a ByDateTime) Swap(i, j int)

type CloudFrontManager

type CloudFrontManager struct {
	BaseUrl        string
	PrivateKeyFile string
	KeyId          string
	Expiration     int
	// contains filtered or unexported fields
}

func (*CloudFrontManager) Init

func (manager *CloudFrontManager) Init() error

func (*CloudFrontManager) SignUrl

func (manager *CloudFrontManager) SignUrl(url string) (signedUrl string)

func (*CloudFrontManager) WriteCookies

func (manager *CloudFrontManager) WriteCookies(w http.ResponseWriter, domain string)

type JsonFilePhotoStore

type JsonFilePhotoStore struct {
	FileName string
	// contains filtered or unexported fields
}

func (*JsonFilePhotoStore) Add

func (jfps *JsonFilePhotoStore) Add(photo Photo) error

func (*JsonFilePhotoStore) Get

func (jfps *JsonFilePhotoStore) Get(fileName string) (Photo, error)

func (*JsonFilePhotoStore) GetAll

func (jfps *JsonFilePhotoStore) GetAll() []Photo

func (*JsonFilePhotoStore) LoadFromFile

func (jfps *JsonFilePhotoStore) LoadFromFile() error

func (*JsonFilePhotoStore) Remove

func (jfps *JsonFilePhotoStore) Remove(photoToRemove Photo) error

func (*JsonFilePhotoStore) RemoveStorageFile

func (jfps *JsonFilePhotoStore) RemoveStorageFile() error

func (*JsonFilePhotoStore) StoreToFile

func (jfps *JsonFilePhotoStore) StoreToFile() error

func (*JsonFilePhotoStore) Touch

func (jfps *JsonFilePhotoStore) Touch() error

type MongoPhotoStore

type MongoPhotoStore struct {
	Url            string
	DbName         string
	CollectionName string
	// contains filtered or unexported fields
}

func (*MongoPhotoStore) EraseDB

func (mpr *MongoPhotoStore) EraseDB()

func (*MongoPhotoStore) LookupPhoto

func (mpr *MongoPhotoStore) LookupPhoto(fileName string) (Photo, error)

func (*MongoPhotoStore) PhotoStream

func (mpr *MongoPhotoStore) PhotoStream() chan Photo

func (*MongoPhotoStore) Ping

func (mpr *MongoPhotoStore) Ping() error

func (*MongoPhotoStore) StorePhoto

func (mpr *MongoPhotoStore) StorePhoto(photo Photo) error

type Photo

type Photo struct {
	DateTime      int
	AlbumDateTime int
	Filename      string
	ThumbUrl      string `json:",omitempty"`
	MediumUrl     string `json:",omitempty"`
}

type S3Manager

type S3Manager struct {
	Bucket     string
	Region     string
	ImagePath  string
	ThumbPath  string
	MediumPath string

	NbConcurrentUploads int
	// contains filtered or unexported fields
}

func (S3Manager) BucketURL

func (manager S3Manager) BucketURL() string

func (*S3Manager) Connect

func (manager *S3Manager) Connect() error

func (*S3Manager) ExistsImage

func (manager *S3Manager) ExistsImage(fileName string) (exists bool, err error)

func (*S3Manager) ExistsMedium

func (manager *S3Manager) ExistsMedium(fileName string) (exists bool, err error)

func (*S3Manager) ExistsThumb

func (manager *S3Manager) ExistsThumb(fileName string) (exists bool, err error)

func (S3Manager) UploadImage

func (manager S3Manager) UploadImage(rs io.ReadSeeker, fileName string) (url string, err error)

func (S3Manager) UploadMedium

func (manager S3Manager) UploadMedium(rs io.ReadSeeker, fileName string) (url string, err error)

func (S3Manager) UploadThumb

func (manager S3Manager) UploadThumb(rs io.ReadSeeker, fileName string) (url string, err error)

Jump to

Keyboard shortcuts

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