Versions in this module Expand all Collapse all v0 v0.0.2 Mar 10, 2020 v0.0.1 Mar 8, 2020 Changes in this version + var MediaLibraryURL = "" + func IsImageFormat(name string) bool + func IsSVGFormat(name string) bool + func IsVideoFormat(name string) bool + func RegisterCallbacks(db *gorm.DB) + func RegisterMediaHandler(name string, handler MediaHandler) + type Base struct + Crop bool + CropOptions map[string]*CropOption + Delete bool + FileHeader FileHeader + FileName string + Options map[string]string + Reader io.Reader + Url string + func (Base) ConfigureQorMetaBeforeInitialize(meta resource.Metaor) + func (b *Base) Cropped(values ...bool) (result bool) + func (b *Base) GetCropOption(name string) *image.Rectangle + func (b *Base) NeedCrop() bool + func (b *Base) Scan(data interface{}) (err error) + func (b Base) Ext() string + func (b Base) GetFileHeader() FileHeader + func (b Base) GetFileName() string + func (b Base) GetSizes() map[string]*Size + func (b Base) GetURL(option *Option, scope *gorm.Scope, field *gorm.Field, templater URLTemplater) string + func (b Base) GetURLTemplate(option *Option) (path string) + func (b Base) IsImage() bool + func (b Base) IsSVG() bool + func (b Base) IsVideo() bool + func (b Base) Retrieve(url string) (*os.File, error) + func (b Base) String() string + func (b Base) URL(styles ...string) string + func (b Base) Value() (driver.Value, error) + type CropOption struct + Height int + Width int + X int + Y int + type FileHeader interface + Open func() (multipart.File, error) + type FileInterface interface + type Media interface + Cropped func(values ...bool) bool + Ext func() string + GetCropOption func(name string) *image.Rectangle + GetFileHeader func() FileHeader + GetFileName func() string + GetSizes func() map[string]*Size + GetURL func(option *Option, scope *gorm.Scope, field *gorm.Field, templater URLTemplater) string + GetURLTemplate func(*Option) string + IsImage func() bool + NeedCrop func() bool + Retrieve func(url string) (FileInterface, error) + Scan func(value interface{}) error + Store func(url string, option *Option, reader io.Reader) error + String func() string + URL func(style ...string) string + Value func() (driver.Value, error) + type MediaHandler interface + CouldHandle func(media Media) bool + Handle func(media Media, file FileInterface, option *Option) error + type Option map[string]string + func (option Option) Get(key string) string + func (option Option) Set(key string, val string) + type Size struct + Height int + Padding bool + Width int + type URLTemplater interface + GetURLTemplate func(*Option) string