16 lines
388 B
Go
16 lines
388 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type APIKey struct {
|
|
ID uint32 `gorm:"primaryKey;autoIncrement"`
|
|
UserID uint32 `gorm:"index;not null"`
|
|
Name string `gorm:"not null"`
|
|
Prefix string `gorm:"not null"`
|
|
HashedKey string `gorm:"uniqueIndex;not null"`
|
|
ExpiresAt *time.Time
|
|
RevokedAt *time.Time
|
|
LastUsedAt *time.Time
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
}
|