Documentation ¶
Index ¶
- Variables
- func BeginLocalSeedFileName()
- type Image
- func (image *Image) CreateImageName(fileSuffix string)
- func (image *Image) CreateImagePath()
- func (p *Image) CreateThumImage()
- func (image *Image) CreateUrl()
- func (image *Image) CreateWebImage()
- func (image *Image) CreateWebUrl()
- func (image *Image) ExistLocal(oriUrl string) (string, int)
- func (p *Image) Get(imgID int) (err error)
- func (image *Image) GetImage2Web()
Constants ¶
This section is empty.
Variables ¶
View Source
var (
LOCAL_SEED_FILE_NAME = make(chan string) // 随机文件名种子
)
文件名字种子
Functions ¶
func BeginLocalSeedFileName ¶
func BeginLocalSeedFileName()
BeginLocalSeedFileName 获取localSeed 为进程维护一个随机文件名
Types ¶
type Image ¶
type Image struct { ID int ImageName string `gorm:"size:128"` ThumName string `gorm:"size:128"` // 缩略图名称 Path string `gorm:"size:128"` Url string `gorm:"size:128"` ThumUrl string `gorm:"size:128"` // 缩略图地址 CreateDate time.Time StaffId int ImageTypeId int OriUrl string `gorm:"size:128"` SourceTypeId int }
func (*Image) CreateImageName ¶
计算文件名 入参: fileSuffix 文件后缀 localSeed 外部种子
func (*Image) CreateThumImage ¶ added in v0.3.4
func (p *Image) CreateThumImage()
CreateThumImage 创建缩略图 绝对路径
func (*Image) ExistLocal ¶
检查图片是否已经存在于本地
Click to show internal directories.
Click to hide internal directories.