photo

package
v0.0.0-...-c9e98ae Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2018 License: AGPL-3.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCache

func InitCache()

InitCache initialize photo cache and set up cleanup cron task.

func Register

func Register(photo *Photo)

Register a photo

Types

type Photo

type Photo struct {
	Secret      string
	Filename    string
	Format      string
	Data        []byte
	Width       int
	Height      int
	Thumb       []byte
	ThumbWidth  int
	ThumbHeight int
	CreatedAt   time.Time
}

Photo represents uploaded image

func Fetch

func Fetch(key string) *Photo

Fetch from image cache

func NewPhoto

func NewPhoto(fileInfo *multipart.FileHeader) (*Photo, error)

NewPhoto creates new Photo instance from fileheader

Jump to

Keyboard shortcuts

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