Documentation ¶
Index ¶
- func GetViewURLByOriginalURL(viewURL string, width, height interface{}) string
- func ImageOptions(width, height float64, cropOptionsSetters ...func(*imageproxy.Options)) *imageproxy.Options
- type CropOptions
- type CropOptionsSetter
- func CropOptDestFile(destFile string) CropOptionsSetter
- func CropOptFileMD5(fileMD5 string) CropOptionsSetter
- func CropOptFileSchema(fileSchema *dbschema.NgingFile) CropOptionsSetter
- func CropOptOptions(opt *imageproxy.Options, setters ...func(*imageproxy.Options)) CropOptionsSetter
- func CropOptSrcReader(reader io.Reader) CropOptionsSetter
- func CropOptStorer(storer driver.Storer) CropOptionsSetter
- func CropOptWatermarkOptions(watermarkOptions *image.WatermarkOptions) CropOptionsSetter
- type Embedded
- func (f *Embedded) AddFileByIds(fileIds []string, excludeFileIds ...string) error
- func (f *Embedded) DeleteByInstance(m *dbschema.NgingFileEmbedded) error
- func (f *Embedded) DeleteByTableID(project string, table string, tableID string) error
- func (f *Embedded) DeleteFileByIds(fileIds []string, excludeFileIds ...string) error
- func (f *Embedded) FileIDs() []uint64
- func (f *Embedded) FilterNotExistsFileIDs(fids []interface{}, files []interface{}) []interface{}
- func (f *Embedded) RelationEmbeddedFiles(project string, table string, field string, tableID string, v string) error
- func (f *Embedded) RelationFiles(project string, table string, field string, tableID string, v string, ...) error
- func (f *Embedded) ReplacedViewURLs() map[string]string
- func (f *Embedded) UpdateByFileID(project string, table string, field string, tableID string, fileID uint64) error
- func (f *Embedded) UpdateEmbedded(embedded bool, project string, table string, field string, tableID string, ...) (err error)
- func (f *Embedded) Updater(table string, field string, tableID string) *fileupdater.FileUpdater
- type File
- func (f *File) Add(reader io.Reader) error
- func (f *File) CondByOwner(ownerType string, ownerID uint64) db.Compound
- func (f *File) Decr(fileIds ...interface{}) (err error)
- func (f *File) DeleteBy(cond db.Compound) error
- func (f *File) DeleteByID(id uint64, ownerType string, ownerID uint64) (err error)
- func (f *File) DeleteBySavePath(savePath string) (err error)
- func (f *File) FillData(reader io.Reader, forceReset bool, schemas ...*dbschema.NgingFile) error
- func (f *File) FnGetByMd5() func(r *uploadClient.Result) error
- func (f *File) GetAvatar() (*dbschema.NgingFile, error)
- func (f *File) GetBySavePath(storerInfo storer.Info, savePath string) (err error)
- func (f *File) GetByStorerAndURL(storerInfo storer.Info, viewURL string) (err error)
- func (f *File) GetByViewURL(viewURL string) (err error)
- func (f *File) GetIDByIDs(ids []interface{}) (r []interface{})
- func (f *File) GetIDByViewURLs(viewURLs []interface{}) (r []interface{})
- func (f *File) GetViewURLByIds(ids ...interface{}) (r map[string]interface{})
- func (f *File) Incr(fileIds ...interface{}) (err error)
- func (f *File) NewFile(m *dbschema.NgingFile) *File
- func (f *File) RemoveUnused(ago int64, ownerType string, ownerID uint64) error
- func (f *File) RemoveUnusedAvatar(ownerType string, excludeID uint64) error
- func (f *File) SetByUploadResult(result *uploadClient.Result) *File
- type Moved
- type Thumb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetViewURLByOriginalURL ¶
func ImageOptions ¶
func ImageOptions(width, height float64, cropOptionsSetters ...func(*imageproxy.Options)) *imageproxy.Options
Types ¶
type CropOptions ¶
type CropOptions struct { Options *imageproxy.Options //裁剪方式设置 File *dbschema.NgingFile //原图信息 SrcReader io.Reader //原图reader Storer driver.Storer //存储器 DestFile string //保存文件路径 FileMD5 string //原图MD5 WatermarkOptions *image.WatermarkOptions //水印图片文件 // contains filtered or unexported fields }
CropOptions 图片裁剪选项
func (*CropOptions) ApplySetter ¶
func (c *CropOptions) ApplySetter(setters ...CropOptionsSetter) *CropOptions
func (*CropOptions) SetThumbData ¶
func (c *CropOptions) SetThumbData(thumbData *bytes.Reader) *CropOptions
func (*CropOptions) ThumbData ¶
func (c *CropOptions) ThumbData() *bytes.Reader
type CropOptionsSetter ¶
type CropOptionsSetter func(options *CropOptions)
func CropOptDestFile ¶
func CropOptDestFile(destFile string) CropOptionsSetter
func CropOptFileMD5 ¶
func CropOptFileMD5(fileMD5 string) CropOptionsSetter
func CropOptFileSchema ¶
func CropOptFileSchema(fileSchema *dbschema.NgingFile) CropOptionsSetter
func CropOptOptions ¶
func CropOptOptions(opt *imageproxy.Options, setters ...func(*imageproxy.Options)) CropOptionsSetter
func CropOptSrcReader ¶
func CropOptSrcReader(reader io.Reader) CropOptionsSetter
func CropOptStorer ¶
func CropOptStorer(storer driver.Storer) CropOptionsSetter
func CropOptWatermarkOptions ¶
func CropOptWatermarkOptions(watermarkOptions *image.WatermarkOptions) CropOptionsSetter
type Embedded ¶
type Embedded struct { *dbschema.NgingFileEmbedded File *File Moved *Moved // contains filtered or unexported fields }
func (*Embedded) AddFileByIds ¶
func (*Embedded) DeleteByInstance ¶
func (f *Embedded) DeleteByInstance(m *dbschema.NgingFileEmbedded) error
func (*Embedded) DeleteByTableID ¶
DeleteByTableID 删除嵌入文件
func (*Embedded) DeleteFileByIds ¶
func (*Embedded) FilterNotExistsFileIDs ¶
func (f *Embedded) FilterNotExistsFileIDs(fids []interface{}, files []interface{}) []interface{}
FilterNotExistsFileIDs 仅仅提取数据库中有记录的数据
func (*Embedded) RelationEmbeddedFiles ¶
func (f *Embedded) RelationEmbeddedFiles(project string, table string, field string, tableID string, v string) error
RelationEmbeddedFiles 关联嵌入的文件 @param project 项目名称 @param table 表名称 @param field 被嵌入的字段名 @param tableID 表中行主键ID @param v 内容 @return @author AdamShen <swh@admpub.com>
func (*Embedded) RelationFiles ¶
func (*Embedded) ReplacedViewURLs ¶
func (*Embedded) UpdateByFileID ¶
func (*Embedded) UpdateEmbedded ¶
func (*Embedded) Updater ¶
func (f *Embedded) Updater(table string, field string, tableID string) *fileupdater.FileUpdater
type File ¶
func (*File) CondByOwner ¶
CondByOwner 所有者条件
func (*File) DeleteByID ¶
func (*File) DeleteBySavePath ¶
func (*File) FnGetByMd5 ¶
func (f *File) FnGetByMd5() func(r *uploadClient.Result) error
func (*File) GetBySavePath ¶
func (*File) GetByStorerAndURL ¶
func (*File) GetByViewURL ¶
func (*File) GetIDByIDs ¶
func (f *File) GetIDByIDs(ids []interface{}) (r []interface{})
func (*File) GetIDByViewURLs ¶
func (f *File) GetIDByViewURLs(viewURLs []interface{}) (r []interface{})
func (*File) GetViewURLByIds ¶
func (*File) RemoveUnused ¶
func (*File) RemoveUnusedAvatar ¶
func (*File) SetByUploadResult ¶
func (f *File) SetByUploadResult(result *uploadClient.Result) *File
type Moved ¶
type Moved struct {
*dbschema.NgingFileMoved
}
func (*Moved) ListByViewURLs ¶
func (t *Moved) ListByViewURLs(viewURLs []interface{}) ([]*dbschema.NgingFileMoved, error)
type Thumb ¶
type Thumb struct {
*dbschema.NgingFileThumb
}
func (*Thumb) GetByOriginalViewURL ¶
func (*Thumb) GetByViewURL ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.