mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
17 lines
400 B
Go
17 lines
400 B
Go
package models
|
||
|
||
import (
|
||
"time"
|
||
|
||
"gorm.io/gorm"
|
||
)
|
||
|
||
// APIKey is stored **hashed** (SHA‑256) and may be revoked at any time.
|
||
type APIKey struct {
|
||
ID uint `gorm:"primaryKey"`
|
||
Hash []byte `gorm:"uniqueIndex"`
|
||
Label string // e.g. “mobile‑app”, “data‑partner‑X”
|
||
Revoked bool
|
||
CreatedAt time.Time
|
||
RevokedAt gorm.DeletedAt `gorm:"index"`
|
||
} |