db

package
v0.0.0-...-9ca138e Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2018 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUserExists

func IsUserExists(database *gorm.DB, email string) (bool, error)

func SetRegistrationIDVerified

func SetRegistrationIDVerified(database *gorm.DB, user UserModel, registrationID uuid.UUID) error

func ValidateSession

func ValidateSession(database *gorm.DB, sessionID uuid.UUID) uuid.UUID

Types

type Session

type Session struct {
	SessionID uuid.UUID `gorm:"primary_key"`

	UserModelID uuid.UUID `gorm:"index:session_user_id_idx;not null"`

	LoginTime time.Time `gorm:"index:session_user_id_idx;not null"`

	LastSeenTime time.Time `gorm:"index:session_user_id_idx;not null"`
}

func GetSession

func GetSession(database *gorm.DB, userid uuid.UUID) (Session, error)

func (Session) TableName

func (pc Session) TableName() string

type UserModel

type UserModel struct {
	ID uuid.UUID

	Email string `gorm:"index:user_email_idx;not null"`
}

func SelectUserByEmail

func SelectUserByEmail(database *gorm.DB, email string) (UserModel, error)

func SelectUserByRegisterID

func SelectUserByRegisterID(database *gorm.DB, registerID uuid.UUID) (UserModel, error)

func (UserModel) TableName

func (pc UserModel) TableName() string

type UserRegistration

type UserRegistration struct {
	UserID uuid.UUID `gorm:"primary_key"`

	RegistrationID uuid.UUID `gorm:"primary_key;"`

	Confirmed bool
}

func SelectUserRegistration

func SelectUserRegistration(database *gorm.DB, registerID uuid.UUID) (UserRegistration, error)

func (UserRegistration) TableName

func (ur UserRegistration) TableName() string

Jump to

Keyboard shortcuts

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