Documentation
¶
Index ¶
Constants ¶
View Source
const (
// FileNameMinLength 规定包括后缀名在内文件名长度不可小于 5.
FileNameMinLength = 3
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct { ID string Name string Count int // how many files with the same name Size int64 Type string Thumb bool // has a thumbnail or not Hash string // checksum Like int64 // 点赞 CTime int64 // created at UTime int64 // updated at Checked int64 // checked at 上次校验时间 Damaged bool // 上次校验结果(文件是否损坏) Deleted bool Tags []string // 该项目不在数据库中,放在这里只是为了方便 }
File 文件
func (*File) SetNameType ¶
SetNameType 同时设置 Name 和 Type. 使用 SetNameType 可确保正确设置 Type.
type ShortID ¶
ShortID 用来生成 “可爱” 的自增 ID. 说它可爱是因为它的字符串形式: 1.短 2.由数字和字母组成,不分大小写,且确保以字母开头 3.趋势自增,但又不明显自增 4.可利用前缀分类 该 ID 由前缀、年份与自增数三部分组成,年份与自增数分别转 36 进制字符。 前缀只能是单个字母,因为 ID 还是短一些的好。 注意:前缀不分大小写, ShortID 本身也不分大小写。
Click to show internal directories.
Click to hide internal directories.