Documentation
¶
Index ¶
Constants ¶
View Source
const ( OneMonth = 31 * 24 * 60 * 60 MaxCount = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractPaste ¶
type AbstractPaste struct { Key string `json:"key" swaggerignore:"true" gorm:"type:varchar(16);primaryKey"` // 主键:索引 Lang string `json:"lang" example:"plain" gorm:"type:varchar(16)"` // 语言类型 Content string `json:"content" example:"Hello World!" gorm:"type:mediumtext"` // 内容,最大长度为 16777215(2^24-1) 个字符 Password string `json:"password" example:"" gorm:"type:varchar(32)"` // 密码 ClientIP string `json:"client_ip" swaggerignore:"true" gorm:"type:varchar(64)"` // 用户 IP Username string `json:"username" swaggerignore:"true" gorm:"type:varchar(16)"` // 用户名 CreatedAt time.Time `swaggerignore:"true"` // 存储记录的创建时间 }
func (*AbstractPaste) GetContent ¶
func (paste *AbstractPaste) GetContent() string
func (*AbstractPaste) GetKey ¶
func (paste *AbstractPaste) GetKey() string
func (*AbstractPaste) GetLang ¶
func (paste *AbstractPaste) GetLang() string
type Permanent ¶
type Permanent struct { *AbstractPaste // 存储记录的删除时间 // 删除具有 DeletedAt 字段的记录,它不会从数据库中删除,但只将字段 DeletedAt 设置为当前时间,并在查询时无法找到记录 DeletedAt gorm.DeletedAt }
Permanent 永久
type Temporary ¶
type Temporary struct { *AbstractPaste // 公有字段 ExpireSecond uint64 `json:"expire_second"` // 过期时间 ExpireCount uint64 `json:"expire_count"` // 过期的次数 }
Temporary 临时
Click to show internal directories.
Click to hide internal directories.