Documentation ¶
Index ¶
- Constants
- Variables
- type MediaBox
- func (mediaBox *MediaBox) IsImage() bool
- func (mediaBox *MediaBox) IsSVG() bool
- func (mediaBox *MediaBox) IsVideo() bool
- func (mediaBox *MediaBox) Scan(data interface{}) (err error)
- func (mediaBox *MediaBox) URL(styles ...string) string
- func (mediaBox *MediaBox) URLNoCached(styles ...string) string
- func (mediaBox MediaBox) Value() (driver.Value, error)
- func (mediaBox MediaBox) WebpURL(styles ...string) string
- type MediaBoxConfig
- type MediaLibrary
- type MediaLibraryStorage
- func (mediaLibraryStorage *MediaLibraryStorage) GetSizes() map[string]*base.Size
- func (mediaLibraryStorage *MediaLibraryStorage) Scan(data interface{}) (err error)
- func (mediaLibraryStorage *MediaLibraryStorage) URL(styles ...string) string
- func (mediaLibraryStorage MediaLibraryStorage) Value() (driver.Value, error)
- type MediaOption
Constants ¶
View Source
const ( ALLOW_TYPE_FILE = "file" ALLOW_TYPE_IMAGE = "image" ALLOW_TYPE_VIDEO = "video" )
Variables ¶
View Source
var ( QorPreviewSizeName = "@qor_preview" QorPreviewMaxSize = 200 )
Functions ¶
This section is empty.
Types ¶
type MediaBox ¶
type MediaBox struct { ID json.Number Url string VideoLink string FileName string Description string FileSizes map[string]int `json:",omitempty"` // for default image Width int `json:",omitempty"` Height int `json:",omitempty"` }
func (*MediaBox) URLNoCached ¶ added in v3.0.4
type MediaBoxConfig ¶
type MediaBoxConfig struct { Sizes map[string]*base.Size Max uint AllowType string // the background color of MediaBox BackgroundColor string // disable crop DisableCrop bool // allow to accept media_box only with URL SimpleIMGURL bool }
MediaBoxConfig configure MediaBox metas
type MediaLibrary ¶
type MediaLibrary struct { gorm.Model SelectedType string File MediaLibraryStorage `sql:"size:4294967295;" mediaLibrary:"url:/system/{{class}}/{{primary_key}}/{{column}}.{{extension}}"` UserID uint `gorm:"index"` Folder bool `gorm:"default:false"` ParentId uint `gorm:"index;default:0"` }
func (*MediaLibrary) GetMediaOption ¶
func (mediaLibrary *MediaLibrary) GetMediaOption() MediaOption
func (*MediaLibrary) GetSelectedType ¶
func (mediaLibrary *MediaLibrary) GetSelectedType() string
func (*MediaLibrary) ScanMediaOptions ¶
func (mediaLibrary *MediaLibrary) ScanMediaOptions(mediaOption MediaOption) error
func (*MediaLibrary) SetSelectedType ¶
func (mediaLibrary *MediaLibrary) SetSelectedType(typ string)
type MediaLibraryStorage ¶
type MediaLibraryStorage struct { oss.OSS Sizes map[string]*base.Size `json:",omitempty"` Video string SelectedType string Description string }
func (*MediaLibraryStorage) GetSizes ¶
func (mediaLibraryStorage *MediaLibraryStorage) GetSizes() map[string]*base.Size
func (*MediaLibraryStorage) Scan ¶
func (mediaLibraryStorage *MediaLibraryStorage) Scan(data interface{}) (err error)
func (*MediaLibraryStorage) URL ¶
func (mediaLibraryStorage *MediaLibraryStorage) URL(styles ...string) string
type MediaOption ¶
type MediaOption struct { Video string `json:",omitempty"` FileName string `json:",omitempty"` URL string `json:",omitempty"` OriginalURL string `json:",omitempty"` CropOptions map[string]*base.CropOption `json:",omitempty"` Sizes map[string]*base.Size `json:",omitempty"` SelectedType string `json:",omitempty"` Description string `json:",omitempty"` Crop bool }
Click to show internal directories.
Click to hide internal directories.