users

package module
v0.0.0-...-0c168bc Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

README

users

user registration, authentication and authorization system

Documentation

Index

Constants

This section is empty.

Variables

View Source
var App core.App

Functions

func Configure

func Configure(a core.App)

Types

type Confirm

type Confirm struct {
	CheckToken string `json:"checkToken" valid:"required"`
}

type Login

type Login struct {
	Email    string `valid:"email,required" json:"email"`
	Password string `valid:"ascii,required" json:"password"`
}

type Profile

type Profile struct {
	gorm.Model
	Firstname  string `json:"firstname"`
	Middlename string `json:"middlename"`
	Lastname   string `json:"lastname"`
	Phone      string `json:"phone"`
	Avatar     string `json:"avatar" gorm:"type:text"`
}

type Reset

type Reset struct {
	CheckToken string `json:"checkToken" valid:"required"`
	Password   string `` /* 170-byte string literal not displayed */
	RePassword string `gorm:"-" json:"repassword" valid:"ascii,required,passmatch~repassword: Passwords do not match"`
}

type ResetRequest

type ResetRequest struct {
	Email       string `json:"email" valid:"email,required"`
	CallBackUrl string `json:"callBackUrl"`
}

type User

type User struct {
	gorm.Model
	Email       string        `json:"email" gorm:"unique;not null" valid:"email,required,unique~email: Email not unique"`
	Password    string        `` /* 170-byte string literal not displayed */
	RePassword  string        `gorm:"-" json:"repassword" valid:"ascii,required,passmatch~repassword: Passwords do not match"`
	Role        string        `json:"role" valid:"in(candidate|user|admin)"`
	Status      string        `json:"status" valid:"in(active|blocked|draft)"`
	Token       string        `json:"token"`
	Salt        string        `json:"-"`
	CheckToken  string        `json:"-"`
	CallBackUrl string        `gorm:"-"`
	Profile     Profile       `json:"profile"`
	ProfileID   int           `json:"profileID"`
	Keywords    []UserKeyword `json:"keywords" gorm:"many2many:userkeywords"`
}

type UserData

type UserData struct {
	Errors []core.ErrorMsg `json:"errors"`
	Data   User            `json:"data"`
}

func (*UserData) Read

func (u *UserData) Read(r *http.Response)

type UserKeyword

type UserKeyword struct {
	gorm.Model
	Name        string `json:"name" gorm:"unique"`
	Description string `json:"description"`
}

type UserKeywordData

type UserKeywordData struct {
	Errors []core.ErrorMsg `json:"errors"`
	Data   UserKeyword     `json:"data"`
}

func (*UserKeywordData) Read

func (u *UserKeywordData) Read(r *http.Response)

type UserKeywordsData

type UserKeywordsData struct {
	Errors []core.ErrorMsg `json:"errors"`
	Data   []UserKeyword   `json:"data"`
}

func (*UserKeywordsData) Read

func (u *UserKeywordsData) Read(r *http.Response)

type UserUpdate

type UserUpdate struct {
	Password   string  `` /* 161-byte string literal not displayed */
	RePassword string  `json:"repassword" valid:"ascii,passmatch~repassword: Passwords do not match"`
	Role       string  `json:"role"`
	Salt       string  `json:"-"`
	Status     string  `json:"status" valid:"required,in(active|blocked|draft)"`
	Profile    Profile `json:"profile"`
}

type Users

type Users []User

Jump to

Keyboard shortcuts

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