Documentation ¶
Index ¶
- Variables
- func SaveAndCropImage(isCreate bool) func(scope *gorm.Scope)
- type Base
- func (b *Base) GetCropOption() *image.Rectangle
- func (b Base) GetFileHeader() *multipart.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) string
- func (b Base) GetURLTemplate(option *Option) (path string)
- func (b Base) IsImage() bool
- func (b Base) Retrieve(url string) (*os.File, error)
- func (b *Base) Scan(data interface{}) (err error)
- func (b *Base) SetCropOption(option *CropOption)
- func (b Base) String() string
- func (b Base) URL(styles ...string) string
- func (b Base) Value() (driver.Value, error)
- type CropOption
- type FileSystem
- type MediaLibrary
- type Option
- type Size
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplemented = errors.New("not implemented")
Functions ¶
func SaveAndCropImage ¶
Types ¶
type Base ¶
type Base struct { FileName string Url string CropOption *CropOption `json:",omitempty"` Crop bool `json:"-"` Valid bool `json:"-"` FileHeader *multipart.FileHeader `json:"-"` Reader io.Reader `json:"-"` }
func (*Base) GetCropOption ¶
func (Base) GetFileHeader ¶
func (b Base) GetFileHeader() *multipart.FileHeader
func (Base) GetFileName ¶
func (Base) GetURLTemplate ¶
func (*Base) SetCropOption ¶
func (b *Base) SetCropOption(option *CropOption)
type CropOption ¶
type CropOption struct {
X, Y, Width, Height int
}
type FileSystem ¶
type FileSystem struct {
Base
}
func (FileSystem) GetFullPath ¶
func (f FileSystem) GetFullPath(url string, option *Option) (path string, err error)
type MediaLibrary ¶
type MediaLibrary interface { Scan(value interface{}) error Value() (driver.Value, error) GetURLTemplate(*Option) string GetURL(option *Option, scope *gorm.Scope, field *gorm.Field) string GetFileHeader() *multipart.FileHeader GetFileName() string GetSizes() map[string]Size SetCropOption(*CropOption) GetCropOption() *image.Rectangle Store(url string, option *Option, reader io.Reader) error Retrieve(url string) (*os.File, error) IsImage() bool URL(style ...string) string String() string }
Click to show internal directories.
Click to hide internal directories.