scheme

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameAccessToken = "access_tokens"
View Source
const TableNameApp = "apps"
View Source
const TableNameAuth = "auths"
View Source
const TableNameCode = "code"
View Source
const TableNameConsent = "consents"
View Source
const TableNameDiscord = "discords"
View Source
const TableNameIDToken = "id_tokens"
View Source
const TableNameOidcAuthorization = "oidc_authorizations"
View Source
const TableNameOidcToken = "oidc_tokens"
View Source
const TableNameRedirectURI = "redirect_uris"
View Source
const TableNameRefreshToken = "refresh_tokens"
View Source
const TableNameRole = "roles"
View Source
const TableNameSession = "sessions"
View Source
const TableNameTokenSet = "token_sets"
View Source
const TableNameUser = "users"
View Source
const TableNameUserApp = "user_app"
View Source
const TableNameUserRole = "user_role"

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	ID       int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Hash     string    `gorm:"column:hash;not null" json:"hash"`
	Type     string    `gorm:"column:type;not null" json:"type"`
	Scope    string    `gorm:"column:scope;not null" json:"scope"`
	IssuedAt time.Time `gorm:"column:issued_at;not null" json:"issued_at"`
	Exp      time.Time `gorm:"column:exp;not null" json:"exp"`
	ClientID string    `gorm:"column:client_id;not null;comment:アプリケーションID" json:"client_id"` // アプリケーションID
	UserID   string    `gorm:"column:user_id;not null" json:"user_id"`
	Revoked  bool      `gorm:"column:revoked;not null" json:"revoked"`
}

AccessToken mapped from table <access_tokens>

func (*AccessToken) TableName

func (*AccessToken) TableName() string

TableName AccessToken's table name

type App

type App struct {
	ID           string    `gorm:"column:id;primaryKey" json:"id"`
	ClientID     string    `gorm:"column:client_id;not null" json:"client_id"`
	Aud          string    `gorm:"column:aud;not null" json:"aud"`
	ClientSecret string    `gorm:"column:client_secret;not null" json:"client_secret"`
	Name         string    `gorm:"column:name;not null" json:"name"`
	CreatedAt    time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	IsEnable     bool      `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}

App mapped from table <apps>

func (*App) TableName

func (*App) TableName() string

TableName App's table name

type Auth

type Auth struct {
	ID         int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	AuthUserID string    `gorm:"column:auth_user_id;not null" json:"auth_user_id"`
	AppID      string    `gorm:"column:app_id;not null" json:"app_id"`
	CreatedAt  time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	IsEnable   bool      `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}

Auth mapped from table <auths>

func (*Auth) TableName

func (*Auth) TableName() string

TableName Auth's table name

type Code

type Code struct {
	ID        int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Token     string    `gorm:"column:token;not null" json:"token"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	Exp       time.Time `gorm:"column:exp" json:"exp"`
	IsEnable  bool      `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}

Code mapped from table <code>

func (*Code) TableName

func (*Code) TableName() string

TableName Code's table name

type Consent struct {
	ID       int32  `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Scope    string `gorm:"column:scope" json:"scope"`
	IsEnable bool   `gorm:"column:is_enable" json:"is_enable"`
}

Consent mapped from table <consents>

func (*Consent) TableName

func (*Consent) TableName() string

TableName Consent's table name

type Discord

type Discord struct {
	ID        int32  `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	DiscordID string `gorm:"column:discord_id;not null" json:"discord_id"`
	UserID    string `gorm:"column:user_id;not null" json:"user_id"`
}

Discord mapped from table <discords>

func (*Discord) TableName

func (*Discord) TableName() string

TableName Discord's table name

type IDToken

type IDToken struct {
	ID       int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Hash     string    `gorm:"column:hash;not null" json:"hash"`
	Type     string    `gorm:"column:type;not null" json:"type"`
	Scope    string    `gorm:"column:scope;not null" json:"scope"`
	IssuedAt time.Time `gorm:"column:issued_at;not null" json:"issued_at"`
	Exp      time.Time `gorm:"column:exp;not null" json:"exp"`
	ClientID string    `gorm:"column:client_id;not null;comment:アプリケーションID" json:"client_id"` // アプリケーションID
	Aud      string    `gorm:"column:aud;not null" json:"aud"`
	Nonce    string    `gorm:"column:nonce" json:"nonce"`
	AuthTime time.Time `gorm:"column:auth_time" json:"auth_time"`
	Acr      string    `gorm:"column:acr" json:"acr"`
	Amr      string    `gorm:"column:amr" json:"amr"`
	Jti      string    `gorm:"column:jti;not null" json:"jti"`
	UserID   string    `gorm:"column:user_id;not null" json:"user_id"`
	Revoked  bool      `gorm:"column:revoked;not null" json:"revoked"`
}

IDToken mapped from table <id_tokens>

func (*IDToken) TableName

func (*IDToken) TableName() string

TableName IDToken's table name

type OidcAuthorization

type OidcAuthorization struct {
	ID        int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	AuthID    int32     `gorm:"column:auth_id;not null" json:"auth_id"`
	CodeID    int32     `gorm:"column:code_id;not null" json:"code_id"`
	ConsentID int32     `gorm:"column:consent_id;not null" json:"consent_id"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
}

OidcAuthorization mapped from table <oidc_authorizations>

func (*OidcAuthorization) TableName

func (*OidcAuthorization) TableName() string

TableName OidcAuthorization's table name

type OidcToken

type OidcToken struct {
	ID                  int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	OidcAuthorizationID int32 `gorm:"column:oidc_authorization_id;not null" json:"oidc_authorization_id"`
	AccessTokenID       int32 `gorm:"column:access_token_id;not null" json:"access_token_id"`
	RefreshTokenID      int32 `gorm:"column:refresh_token_id;not null" json:"refresh_token_id"`
	IsEnable            bool  `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}

OidcToken mapped from table <oidc_tokens>

func (*OidcToken) TableName

func (*OidcToken) TableName() string

TableName OidcToken's table name

type RedirectURI

type RedirectURI struct {
	ID        int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	AppID     string    `gorm:"column:app_id;not null" json:"app_id"`
	URI       string    `gorm:"column:uri;not null" json:"uri"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
}

RedirectURI mapped from table <redirect_uris>

func (*RedirectURI) TableName

func (*RedirectURI) TableName() string

TableName RedirectURI's table name

type RefreshToken

type RefreshToken struct {
	ID       int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Hash     string    `gorm:"column:hash;not null" json:"hash"`
	Type     string    `gorm:"column:type;not null" json:"type"`
	IssuedAt time.Time `gorm:"column:issued_at;not null" json:"issued_at"`
	Exp      time.Time `gorm:"column:exp;not null" json:"exp"`
	ClientID string    `gorm:"column:client_id;not null;comment:アプリケーションID" json:"client_id"` // アプリケーションID
	UserID   string    `gorm:"column:user_id;not null" json:"user_id"`
	Revoked  bool      `gorm:"column:revoked;not null" json:"revoked"`
}

RefreshToken mapped from table <refresh_tokens>

func (*RefreshToken) TableName

func (*RefreshToken) TableName() string

TableName RefreshToken's table name

type Role

type Role struct {
	ID          string    `gorm:"column:id;primaryKey" json:"id"`
	CustomID    string    `gorm:"column:custom_id" json:"custom_id"`
	Permissions int32     `gorm:"column:permissions;not null" json:"permissions"`
	CreatedAt   time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt   time.Time `gorm:"column:updated_at" json:"updated_at"`
	IsEnable    bool      `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
	System      bool      `gorm:"column:system;not null" json:"system"`
}

Role ロール情報

func (*Role) TableName

func (*Role) TableName() string

TableName Role's table name

type Session

type Session struct {
	ID        string    `gorm:"column:id;primaryKey" json:"id"`
	UserID    string    `gorm:"column:user_id;not null" json:"user_id"`
	IPAddress string    `gorm:"column:ip_address;not null" json:"ip_address"`
	UserAgent string    `gorm:"column:user_agent;not null" json:"user_agent"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	IsEnable  bool      `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}

Session mapped from table <sessions>

func (*Session) TableName

func (*Session) TableName() string

TableName Session's table name

type TokenSet

type TokenSet struct {
	ID                  int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	OidcAuthorizationID int32 `gorm:"column:oidc_authorization_id;not null" json:"oidc_authorization_id"`
	AccessTokenID       int32 `gorm:"column:access_token_id;not null" json:"access_token_id"`
	RefreshTokenID      int32 `gorm:"column:refresh_token_id;not null" json:"refresh_token_id"`
	IsEnable            bool  `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}

TokenSet mapped from table <token_sets>

func (*TokenSet) TableName

func (*TokenSet) TableName() string

TableName TokenSet's table name

type User

type User struct {
	ID            string     `gorm:"column:id;primaryKey" json:"id"`
	CustomID      string     `gorm:"column:custom_id" json:"custom_id"`
	Name          string     `gorm:"column:name;not null" json:"name"`
	PasswordHash  string     `gorm:"column:password_hash" json:"password_hash"`
	Email         string     `gorm:"column:email" json:"email"`
	ExternalEmail string     `gorm:"column:external_email;not null" json:"external_email"`
	Period        string     `gorm:"column:period;not null" json:"period"`
	JoinedAt      *time.Time `gorm:"column:joined_at" json:"joined_at"`
	IsSystem      bool       `gorm:"column:is_system;not null" json:"is_system"`
	CreatedAt     time.Time  `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt     time.Time  `gorm:"column:updated_at" json:"updated_at"`
	IsEnable      bool       `gorm:"column:is_enable;default:1" json:"is_enable"`
}

User mapped from table <users>

func (*User) TableName

func (*User) TableName() string

TableName User's table name

type UserApp

type UserApp struct {
	ID     int32  `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	AppID  string `gorm:"column:app_id" json:"app_id"`
	UserID string `gorm:"column:user_id" json:"user_id"`
}

UserApp mapped from table <user_app>

func (*UserApp) TableName

func (*UserApp) TableName() string

TableName UserApp's table name

type UserRole

type UserRole struct {
	ID     int32  `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UserID string `gorm:"column:user_id;not null" json:"user_id"`
	RoleID string `gorm:"column:role_id;not null" json:"role_id"`
}

UserRole mapped from table <user_role>

func (*UserRole) TableName

func (*UserRole) TableName() string

TableName UserRole's table name

Jump to

Keyboard shortcuts

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