models

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	ID        string `gorm:"primaryKey"`
	Token     string `gorm:"uniqueIndex;not null"`
	TokenType string `gorm:"not null;default:'Bearer'"`
	UserID    string `gorm:"not null;index"`
	ClientID  string `gorm:"not null;index"`
	Scopes    string `gorm:"not null"` // space-separated scopes
	ExpiresAt time.Time
	CreatedAt time.Time
}

func (*AccessToken) IsExpired

func (t *AccessToken) IsExpired() bool

type DeviceCode

type DeviceCode struct {
	DeviceCode   string `gorm:"primaryKey"`
	UserCode     string `gorm:"uniqueIndex;not null"`
	ClientID     string `gorm:"not null;index"`
	Scopes       string `gorm:"not null"` // space-separated scopes
	ExpiresAt    time.Time
	Interval     int    // polling interval in seconds
	UserID       string // filled after authorization
	Authorized   bool   `gorm:"default:false"`
	AuthorizedAt time.Time
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func (*DeviceCode) IsExpired

func (d *DeviceCode) IsExpired() bool

type OAuthClient

type OAuthClient struct {
	ClientID   string `gorm:"primaryKey"`
	ClientName string `gorm:"not null"`
	Scopes     string `gorm:"not null"` // space-separated scopes
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

func (OAuthClient) TableName

func (OAuthClient) TableName() string

TableName overrides the table name used by OAuthClient to `oauth_client`

type User

type User struct {
	ID           string `gorm:"primaryKey"`
	Username     string `gorm:"uniqueIndex;not null"`
	PasswordHash string `gorm:"not null"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL