Documentation
¶
Index ¶
- func DropDB() error
- func InitDB() error
- func UpgradeDB(fromVersion string, toVersion string) error
- type ApiKey
- func (c *ApiKey) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *ApiKey) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*ApiKey, error)
- func (c *ApiKey) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*ApiKey, int64, error)
- func (c *ApiKey) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApiKey ¶
type ApiKey struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"` // 主键ID
Username string `gorm:"index;not null" json:"username,omitempty"` // 用户名
Key string `gorm:"type:text" json:"key,omitempty"` // API密钥值,未来可通过比对做校验,可校验是否用户签发,可阻止失效
Description string `json:"description,omitempty"` // 密钥描述信息
ExpiresAt time.Time `json:"expires_at,omitempty"` // 过期时间
CreatedAt time.Time `json:"created_at,omitempty" gorm:"<-:create"` // 创建时间
UpdatedAt time.Time `json:"updated_at,omitempty"` // 更新时间
CreatedBy string `json:"created_by,omitempty"` // 创建人
}
Click to show internal directories.
Click to hide internal directories.