Documentation ¶
Index ¶
- Constants
- type Image
- type ImageMetadata
- type ImgManager
- func (im *ImgManager) DeleteImg(paths []string)
- func (im *ImgManager) DeleteSingleImg(path string) error
- func (im *ImgManager) DeleteSingleImgAsync(path string)
- func (im *ImgManager) Drive() StorageDrive
- func (im *ImgManager) GenerateThumbnail(path string, content []byte) error
- func (im *ImgManager) GenerateThumbnailAsync(path string, content []byte)
- func (im *ImgManager) GetImg(path string) (*Image, error)
- func (im *ImgManager) GetOffset(path string, offset int64) (*Image, error)
- func (im *ImgManager) GetThumbnail(path string) (*Image, error)
- func (im *ImgManager) RangeByDate(date time.Time, f func(path string, size int64) bool) error
- func (im *ImgManager) SetDrive(dri StorageDrive)
- func (im *ImgManager) UploadImg(content, thumbnailContent io.Reader, contentSize, thumbnailSize int64, ...) error
- func (im *ImgManager) UploadImgAsync(path string, content []byte, lastModified time.Time)
- func (im *ImgManager) UploadVideo(content, thumbnailContent io.Reader, contentSize, thumbnailSize int64, ...) error
- type Option
- type StorageDrive
- type UnimplementedDrive
- func (d *UnimplementedDrive) Delete(path string) error
- func (d *UnimplementedDrive) Download(path string) (io.ReadCloser, int64, error)
- func (d *UnimplementedDrive) DownloadWithOffset(path string, offset int64) (io.ReadCloser, int64, error)
- func (d *UnimplementedDrive) IsExist(path string) (bool, error)
- func (d *UnimplementedDrive) Range(dir string, deal func(fs.FileInfo) bool) error
- func (d *UnimplementedDrive) Upload(_ string, _ io.ReadCloser, _ int64, _ time.Time) error
Constants ¶
View Source
const ( JpegSuffix = ".jpg" PngSuffix = ".png" DngSuffix = ".dng" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Image struct { Content io.ReadCloser Path string Size int64 ImageMetadata }
type ImageMetadata ¶
type ImageMetadata struct { Model string Datetime string CreateDate string DateTimeOriginal string ModifyDate string }
func GetImageMetadata ¶
func GetImageMetadata(content []byte) (ImageMetadata, error)
type ImgManager ¶
type ImgManager struct {
// contains filtered or unexported fields
}
func NewImgManager ¶
func NewImgManager(opt Option) *ImgManager
func (*ImgManager) DeleteImg ¶
func (im *ImgManager) DeleteImg(paths []string)
func (*ImgManager) DeleteSingleImg ¶
func (im *ImgManager) DeleteSingleImg(path string) error
func (*ImgManager) DeleteSingleImgAsync ¶
func (im *ImgManager) DeleteSingleImgAsync(path string)
func (*ImgManager) Drive ¶
func (im *ImgManager) Drive() StorageDrive
func (*ImgManager) GenerateThumbnail ¶
func (im *ImgManager) GenerateThumbnail(path string, content []byte) error
func (*ImgManager) GenerateThumbnailAsync ¶
func (im *ImgManager) GenerateThumbnailAsync(path string, content []byte)
func (*ImgManager) GetOffset ¶
func (im *ImgManager) GetOffset(path string, offset int64) (*Image, error)
func (*ImgManager) GetThumbnail ¶
func (im *ImgManager) GetThumbnail(path string) (*Image, error)
func (*ImgManager) RangeByDate ¶
func (*ImgManager) SetDrive ¶
func (im *ImgManager) SetDrive(dri StorageDrive)
func (*ImgManager) UploadImgAsync ¶
func (im *ImgManager) UploadImgAsync(path string, content []byte, lastModified time.Time)
func (*ImgManager) UploadVideo ¶
type StorageDrive ¶
type StorageDrive interface { Upload(string, io.ReadCloser, int64, time.Time) error // IsExist(path string) (bool, error) Download(path string) (io.ReadCloser, int64, error) DownloadWithOffset(path string, offset int64) (io.ReadCloser, int64, error) Delete(path string) error Range(dir string, deal func(fs.FileInfo) bool) error }
type UnimplementedDrive ¶
type UnimplementedDrive struct{}
func (*UnimplementedDrive) Delete ¶
func (d *UnimplementedDrive) Delete(path string) error
func (*UnimplementedDrive) Download ¶
func (d *UnimplementedDrive) Download(path string) (io.ReadCloser, int64, error)
func (*UnimplementedDrive) DownloadWithOffset ¶
func (d *UnimplementedDrive) DownloadWithOffset(path string, offset int64) (io.ReadCloser, int64, error)
func (*UnimplementedDrive) IsExist ¶
func (d *UnimplementedDrive) IsExist(path string) (bool, error)
func (*UnimplementedDrive) Upload ¶
func (d *UnimplementedDrive) Upload(_ string, _ io.ReadCloser, _ int64, _ time.Time) error
Click to show internal directories.
Click to hide internal directories.