file

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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

func (image *Image) CreateImageName(fileSuffix string)

计算文件名 入参: fileSuffix 文件后缀 localSeed 外部种子

func (*Image) CreateImagePath

func (image *Image) CreateImagePath()

计算导入路径

func (*Image) CreateThumImage added in v0.3.4

func (p *Image) CreateThumImage()

CreateThumImage 创建缩略图 绝对路径

func (*Image) CreateUrl

func (image *Image) CreateUrl()

计算url

func (*Image) CreateWebImage

func (image *Image) CreateWebImage()

网络抓取的图片信息一次性生成

func (*Image) CreateWebUrl

func (image *Image) CreateWebUrl()

创建一个网络存储的图片地址

func (*Image) ExistLocal

func (image *Image) ExistLocal(oriUrl string) (string, int)

检查图片是否已经存在于本地

func (*Image) Get added in v0.4.1

func (p *Image) Get(imgID int) (err error)

通过编码获取图片

func (*Image) GetImage2Web

func (image *Image) GetImage2Web()

从网络抓取图片

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL