Version: v0.0.0-...-c12dc61 Latest Latest

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

Go to latest
Published: Jun 1, 2020 License: MIT Imports: 13 Imported by: 0




This section is empty.


This section is empty.


func CheckError

func CheckError(err error)

CheckError function check if err not nil then log the error

func CookieDecode

func CookieDecode(w http.ResponseWriter, r *http.Request)

CookieDecode decode the cookie and get the username

func HandlePost

func HandlePost(r *http.Request) map[string][]string

HandlePost function handles Post http method Gets input from form and returns it as map[string][]string

func ServeCreds

func ServeCreds(w http.ResponseWriter, r *http.Request)

ServeCreds update and delete User creds if the front-end credential has been changed

func ServeLogin

func ServeLogin(w http.ResponseWriter, r *http.Request)

ServeLogin handle login process

func ServeRegister

func ServeRegister(w http.ResponseWriter, r *http.Request)

ServeRegister Serve Registration

func ServeShow

func ServeShow(w http.ResponseWriter, r *http.Request)

ServeShow Show User credentials

func ServepwForget

func ServepwForget(w http.ResponseWriter, r *http.Request)

ServepwForget function that handles password recovery process


type CookieUser

type CookieUser struct {
	Username string `json:Username`

CookieUser struct holds username of the current user in the session

type Creds

type Creds struct {
	Updated bool `json:"Updated"`

Creds send Updated if the db is updated

type Email

type Email struct {
	Response bool `json:"Response"`
	IsEqual  bool `json:"IsEqual"`

Email has Response and IsEqual instances we need them in Password recovery process.

type Login

type Login struct {
	IsLog       bool   `json:"IsLog"`
	CookieName  string `json:"CookieName"`
	CookieValue string `json:"CookieValue"`

Login login struct holds values that we need in the frontend to check if we have successfully logged in

type Password

type Password struct {
	Updated bool `json:"Updated"`

Password password struct holds a value which is Updated to inform the frontend that the user password is updated

type Register

type Register struct {
	IsReg bool `json:"IsReg"`

Register IsReg value is sent to inform that the user is successfully registred

type Token

type Token struct {
	Code string

Token is the code that we send to the user to restore his password

type User

type User struct {
	IsEmpty  bool            `json:"isEmpty"`
	CredList pwshow.UserList `json:"CredList"`

User Struct

type UserData

type UserData struct {
	Category   string          `json:"Category"`
	Credential pwshow.UserList `json:"Credential"`

UserData User's data or Credential

Source Files

Jump to

Keyboard shortcuts

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