data

package
v0.0.0-...-1506f53 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateEmail = errors.New("email already exists")
	ErrNoRows         = errors.New("no rows exists")
)

Functions

func ComparePasswordAndHash

func ComparePasswordAndHash(plain, hashed string) (bool, error)

func CreateHashPassword

func CreateHashPassword(plain string) (string, error)

func ValidateUser

func ValidateUser(u *User) error

Types

type Chitra

type Chitra struct {
	ID     int    `json:"id"`
	URL    string `json:"chitra"`
	UserID int    `json:"userid"`
}

type ChitraModel

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

func (ChitraModel) Insert

func (m ChitraModel) Insert(c *Chitra) (*Chitra, error)

type Models

type Models struct {
	UserModel   UserModel
	ChitraModel ChitraModel
}

func NewModels

func NewModels(db *pgx.Conn) *Models

type User

type User struct {
	ID       int    `json:"id"`
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"-" validate:"required,min=5,max=20"`
}

type UserModel

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

func (UserModel) GetUser

func (m UserModel) GetUser(user *User) (*User, error)

func (UserModel) GetUserFromID

func (m UserModel) GetUserFromID(id int) (*User, error)

func (UserModel) Insert

func (m UserModel) Insert(u *User) (*User, error)

Jump to

Keyboard shortcuts

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