user

package
v0.0.0-...-f1b651b Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWTToken

func GenerateJWTToken(c *fiber.Ctx, user User) (string, error)

func LoginHandler

func LoginHandler(c *fiber.Ctx, s Service) error

func SetupUserRoutes

func SetupUserRoutes(app *fiber.App, service Service)

func SignUpHandler

func SignUpHandler(c *fiber.Ctx, s Service) error

Types

type Service

type Service interface {
	// contains filtered or unexported methods
}

type ServiceStruct

type ServiceStruct struct{}

type User

type User struct {
	ID            uint           `json:"id" gorm:"primarykey"`
	CreatedAt     time.Time      `json:"created_at"`
	UpdatedAt     time.Time      `json:"updated_at"`
	DeletedAt     gorm.DeletedAt `json:"deleted_at" gorm:"index"`
	Username      string         `json:"username" gorm:"unique;not null;default:null"`
	Password      string         `json:"password" gorm:"not null;default:null"`
	FirstName     string         `json:"first_name" gorm:"not null;default:null"`
	LastName      string         `json:"last_name" gorm:"not null;default:null"`
	ProfilePicURL string         `json:"profile_pic_url"`
}

type UserResponse

type UserResponse struct {
	ID            uint           `json:"id" gorm:"primarykey"`
	CreatedAt     time.Time      `json:"created_at"`
	UpdatedAt     time.Time      `json:"updated_at"`
	DeletedAt     gorm.DeletedAt `json:"deleted_at" gorm:"index"`
	Username      string         `json:"username" gorm:"unique;not null;default:null"`
	Password      string         `json:"-" gorm:"not null;default:null"`
	FirstName     string         `json:"first_name" gorm:"not null;default:null"`
	LastName      string         `json:"last_name" gorm:"not null;default:null"`
	ProfilePicURL string         `json:"profile_pic_url"`
}

Jump to

Keyboard shortcuts

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