models

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomUser

type CustomUser struct {
	Model
	PID     int64  `gorm:"primaryKey,autoIncrement" json:"p_id"`
	Email   string `json:"email"`
	PwdHash string `json:"-"`
}

type Model

type Model struct {
	ID        uint           `gorm:"primaryKey" json:"id"`
	CreatedAt *time.Time     `json:"created_at"`
	UpdatedAt *time.Time     `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

gorm.Model base structure

type User

type User struct {
	Model
	Username     string `json:"username"`
	Email        string `json:"email"`
	PasswordHash string `json:"-"`
}

type UserPointerFields

type UserPointerFields struct {
	Model
	Username     *string `json:"username"`
	PasswordHash *string `json:"-"`
}

type UserWithInvalidIDField

type UserWithInvalidIDField struct {
	Username     string `json:"username"`
	PasswordHash string `json:"-"`
}

type UserWithInvalidPasswordHashField

type UserWithInvalidPasswordHashField struct {
	Model
	Username string `json:"username"`
}

type UserWithInvalidUsernameField

type UserWithInvalidUsernameField struct {
	Model
	PasswordHash string `json:"-"`
}

Jump to

Keyboard shortcuts

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