UsersBackend

package module
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: MIT Imports: 10 Imported by: 1

README

UsersBackend Readme

Backend untuk Handle data User

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteUser added in v0.0.15

func DeleteUser(Mongoconn *mongo.Database, colname, username string) (deleted interface{}, err error)

func DeleteUserforAdmin added in v0.0.15

func DeleteUserforAdmin(Mongoenv, publickey, dbname, colname string, r *http.Request) string

func GetDataUserForAdmin added in v0.0.3

func GetDataUserForAdmin(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string

func GetOneEmployee added in v0.0.6

func GetOneEmployee(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string

func InsertDataEmployee added in v0.0.6

func InsertDataEmployee(MongoConn *mongo.Database, colname string, emp Employee) (InsertedID interface{})

func InsertEmployee added in v0.0.6

func InsertEmployee(MongoEnv, dbname, colname, publickey string, r *http.Request) string

func IsAdmin added in v0.0.3

func IsAdmin(Tokenstr, PublicKey string) bool

func IsHR added in v0.0.6

func IsHR(TokenStr, Publickey string) bool

func Login

func Login(Privatekey, MongoEnv, dbname, Colname string, r *http.Request) string

func Register

func Register(Mongoenv, dbname string, r *http.Request) string

func ResetPassword added in v0.0.16

func ResetPassword(MongoEnv, publickey, dbname, colname string, r *http.Request) string

func UpdateDataEmployees added in v0.0.6

func UpdateDataEmployees(MongoEnv, dbname, publickey string, r *http.Request) string

func UpdateEmployee added in v0.0.6

func UpdateEmployee(Mongoenv, dbname string, ctx context.Context, emp Employee) (UpdateId interface{})

func UpdatePassword added in v0.0.16

func UpdatePassword(mongoconn *mongo.Database, user pasproj.User) (Updatedid interface{})

Types

type Cred added in v0.0.15

type Cred struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type Division added in v0.0.6

type Division struct {
	DivId   int    `json:"divId" bson:"divId"`
	DivName string `json:"divName" bson:"divName"`
}

type Employee added in v0.0.6

type Employee struct {
	EmployeeId string       `json:"employeeid" bson:"employeeid,omitempty"`
	Name       string       `json:"name" bson:"name,omitempty"`
	Email      string       `json:"email" bson:"email,omitempty"`
	Phone      string       `json:"phone" bson:"phone,omitempty"`
	Division   Division     `json:"division" bson:"division,omitempty"`
	Account    pasproj.User `json:"account" bson:"account,omitempty"`
}

func GetDataEmployee added in v0.0.6

func GetDataEmployee(MongoConn *mongo.Database, colname, empid string) Employee

type ReqUsers added in v0.0.15

type ReqUsers struct {
	Username string `json:"username"`
}

type ResponseBack

type ResponseBack struct {
	Status  int      `json:"status"`
	Message string   `json:"message"`
	Data    []string `json:"data"`
}

type ResponseEmployee added in v0.0.6

type ResponseEmployee struct {
	Status  int      `json:"status"`
	Message string   `json:"message"`
	Data    Employee `json:"data"`
}

type Updated added in v0.0.6

type Updated struct {
	Email string `json:"email" bson:"email"`
	Phone string `json:"phone" bson:"phone"`
}

Jump to

Keyboard shortcuts

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