drivers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGorm

func NewGorm(db *gorm.DB) (authentication.DriverStorage, error)

Types

type GormDriver

type GormDriver struct {
	// contains filtered or unexported fields
}

func (*GormDriver) DelProfile

func (g *GormDriver) DelProfile(profileID authentication.ProfileID) error

func (*GormDriver) DelToken

func (g *GormDriver) DelToken(tokenID authentication.TokenID, profileID authentication.ProfileID) error

func (*GormDriver) EmailDeleteSecretKey

func (g *GormDriver) EmailDeleteSecretKey(key authentication.EmailSecretKey) error

func (*GormDriver) EmailNewSecretKey

func (g *GormDriver) EmailNewSecretKey(key authentication.EmailSecretKey, email string, lifetime int64) error

func (*GormDriver) EmailReadSecretKey

func (g *GormDriver) EmailReadSecretKey(key authentication.EmailSecretKey) (string, error)

func (*GormDriver) GetEmail

func (g *GormDriver) GetEmail(profileID authentication.ProfileID) (email string, err error)

func (*GormDriver) GetLogin

func (g *GormDriver) GetLogin(profileID authentication.ProfileID) (login string, err error)

func (*GormDriver) GetLoginByEmail

func (g *GormDriver) GetLoginByEmail(email string) (login string, err error)

func (*GormDriver) GetPasswordByID

func (g *GormDriver) GetPasswordByID(profileID authentication.ProfileID) (password string, err error)

func (*GormDriver) GetPasswordByLogin

func (g *GormDriver) GetPasswordByLogin(login string) (res *authentication.ResultPasswordByLogin, err error)

func (*GormDriver) GetProfileIDByEmail

func (g *GormDriver) GetProfileIDByEmail(email string) (profileID authentication.ProfileID, err error)

func (*GormDriver) IsUniqueEmail

func (g *GormDriver) IsUniqueEmail(email string) (bool, error)

func (*GormDriver) IsUniqueLogin

func (g *GormDriver) IsUniqueLogin(login string) (bool, error)

func (*GormDriver) NewProfile

func (g *GormDriver) NewProfile(login, email, password string) (authentication.ProfileID, error)

func (*GormDriver) NewToken

func (g *GormDriver) NewToken(tokenID authentication.TokenID, profileID authentication.ProfileID, lifeTime authentication.TokenLifeTime) error

func (*GormDriver) ReadToken

func (*GormDriver) SetEmailByProfileID

func (g *GormDriver) SetEmailByProfileID(profileID authentication.ProfileID, email string) error

func (*GormDriver) SetPasswordProfileByEmail

func (g *GormDriver) SetPasswordProfileByEmail(email string, password string) error

func (*GormDriver) SetPasswordProfileByProfileID

func (g *GormDriver) SetPasswordProfileByProfileID(profileID authentication.ProfileID, password string) error

type GormEmailSecretKeyModel

type GormEmailSecretKeyModel struct {
	Key      string `gorm:"primarykey;size:36;autoIncrement:false"`
	Email    string `gorm:"size:255;"`
	Expiries int64
}

type GormProfileModel

type GormProfileModel struct {
	ID       int64  `gorm:"primarykey"`
	Login    string `gorm:"size:255;uniqueIndex"`
	Email    string `gorm:"size:255;uniqueIndex"`
	Password string `gorm:"size:225"`

	CreatedAt time.Time
	UpdatedAt time.Time
}

type GormTokenModel

type GormTokenModel struct {
	Key      string `gorm:"primarykey;size:36;autoIncrement:false"`
	Expiries int64

	ProfileID int64
	Profile   GormProfileModel `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

Jump to

Keyboard shortcuts

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