dialer

package
v0.0.0-...-17ddb13 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 GetLogout

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

GetLogout logout the user by clearing the cookie value

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)

TODO: not sure 100% need test ServeCreds update and delete User creds if the front-end credential has been changed

func ServeGenPw

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

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

func UploadCredFile

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

UploadCredFile handle uploading csv file here

Types

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 FileUploaded

type FileUploaded struct {
	Lines   []int `json:"Lines"`
	Success bool  `json:"Success"`
}

FileUploaded struct holds informations about how success is the process of uploading credential file

type GenPassword

type GenPassword struct {
	Value string
}

type Login

type Login struct {
	IsLog bool `json:"IsLog"`
}

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

type Logout

type Logout struct {
	IsLogout bool `json:"IsLogout"`
}

Logout holds a bool value to indicate which the user is logged out or not

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

Jump to

Keyboard shortcuts

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