types

package
v0.0.0-...-5591888 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserTokenContext_Session string = "session"
)

Variables

This section is empty.

Functions

func CheckUserPassword

func CheckUserPassword(user *queries.User, password string) bool

func ReflectColumnFields

func ReflectColumnFields(s interface{}) string

Types

type FlashMessage

type FlashMessage struct {
	Severity FlashMessageSeverity
	Content  string
}

type FlashMessageSeverity

type FlashMessageSeverity string
const (
	FlashMessageSeverity_Error   FlashMessageSeverity = "error"
	FlashMessageSeverity_Info    FlashMessageSeverity = "info"
	FlashMessageSeverity_Success FlashMessageSeverity = "success"
)

type NewUserParams

type NewUserParams struct {
	Email                string `schema:"email" validate:"required|email"`
	DisplayName          string `schema:"displayName" validate:"required"`
	Password             string `schema:"password" validate:"required|min_len:8|max_len:80"`
	PasswordConfirmation string `schema:"passwordConfirmation" validate:"required|eq_field:Password"`
}

func (NewUserParams) Messages

func (p NewUserParams) Messages() map[string]string

type StringSlice

type StringSlice []string

func (*StringSlice) Scan

func (a *StringSlice) Scan(value interface{}) error

Scan implements `sql.Scan` interface for `StringSlice`

func (StringSlice) Value

func (a StringSlice) Value() (driver.Value, error)

Value implements `driver.Valuer` interface for `StringSlice`

type User

type User struct {
	ID           int       `db:"id"`
	Email        string    `db:"email"`
	DisplayName  string    `db:"display_name"`
	PasswordHash string    `db:"password_hash"`
	InsertedAt   time.Time `db:"inserted_at"`
	UpdatedAt    time.Time `db:"updated_at"`
}

type WebauthnCredential

type WebauthnCredential struct {
	ID                        int         `db:"id"`
	WebauthnID                []byte      `db:"webauthn_id"`
	UserID                    int         `db:"user_id"`
	DisplayName               string      `db:"display_name"`
	PublicKey                 []byte      `db:"public_key"`
	AttestationType           string      `db:"attestation_type"`
	Transport                 StringSlice `db:"transport"`
	UserPresent               bool        `db:"user_present"`
	UserVerified              bool        `db:"user_verified"`
	BackupEligible            bool        `db:"backup_eligible"`
	BackupState               bool        `db:"backup_state"`
	LastUsedAt                *time.Time  `db:"last_used_at"`
	LastUsedIP                *string     `db:"last_used_at"`
	LastUsedUserAgent         *string     `db:"last_used_user_agent"`
	AuthenticatorAAGUID       []byte      `db:"authenticator_aaguid"`
	AuthenticatorSignCount    uint32      `db:"authenticator_sign_count"`
	AuthenticatorCloneWarning bool        `db:"authenticator_clone_warning"`
	AuthenticatorAttachment   string      `db:"authenticator_attachment"`
	InsertedAt                time.Time   `db:"inserted_at"`
	UpdatedAt                 time.Time   `db:"updated_at"`
}

func (*WebauthnCredential) ToCredential

func (wc *WebauthnCredential) ToCredential() webauthn.Credential

Jump to

Keyboard shortcuts

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