Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SecurityToken ¶
type SecurityToken struct { Id Type.GormUlid `json:"id" gorm:"primaryKey;size:26;not null"` Crypto Crypto.Crypto `json:"crypto" gorm:"size:64;not null"` Type SecurityTokenType.SecurityTokenType `json:"type" gorm:"size:10;not null"` UserId Type.GormUlid `json:"-"` User User.User `json:"user" gorm:"foreignKey:UserId;references:Id;constraint:OnDelete:CASCADE"` CreatedAt time.Time `json:"created_at" gorm:"not null"` ExpiresAt time.Time `json:"expires_at" gorm:"not null"` }
func GenerateRefresh ¶
func GenerateRefresh(id ulid.ULID, user User.User, expiresAt time.Time) *SecurityToken
func GenerateReset ¶
func GenerateReset(id ulid.ULID, user User.User, expiresAt time.Time) *SecurityToken
func (*SecurityToken) IsExpired ¶
func (s *SecurityToken) IsExpired() bool
type SecurityTokenRepository ¶
type SecurityTokenRepository interface { GetById(id ulid.ULID) (*SecurityToken, error) GetByCrypto(crypto Crypto.Crypto) (*SecurityToken, error) GetAllForUser(user User.User) (*[]SecurityToken, error) Add(securityToken *SecurityToken) error Remove(securityToken *SecurityToken) error UpdateOrAdd(securityToken *SecurityToken) error ClearExpiredTokens() error }
Click to show internal directories.
Click to hide internal directories.