UsersBackend

package module
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 15 Imported by: 1

README

UsersBackend Readme cek

Backend untuk Handle data User

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOTP added in v0.2.0

func CreateOTP() string

func DeleteEmployee added in v0.1.1

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

Delete Data

func DeleteEmployeeData added in v0.1.1

func DeleteEmployeeData(mongoconn *mongo.Database, colname, EmpId string) (deletedid interface{}, err error)

func DeleteOTP added in v0.3.0

func DeleteOTP(mcon *mongo.Database, colname, otp string) (deletedid *mongo.DeleteResult)

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

Delete User

func GetAllEmployee added in v0.1.0

func GetAllEmployee(PublicKey, Mongoenv, dbname, colname string, r *http.Request) string

GetAll

func GetCommitwithusername added in v0.3.9

func GetCommitwithusername(MongoConn *mongo.Database, colname, username string) (dest []structure.Commits)

func GetDataUserForAdmin added in v0.0.3

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

Get Data User

func GetOneEmployee added in v0.0.6

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

Get One

func GetOtpExists added in v0.3.0

func GetOtpExists(mongoconn *mongo.Database, colname, otp string) (exists bool)

func GetSalaryAll added in v0.4.2

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

func GetSalaryEmployee added in v0.3.9

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

func GetWgebyMonth added in v0.3.9

func GetWgebyMonth(MongoConn *mongo.Database, month, name string) bool

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

Insert data

func InsertOtp added in v0.2.0

func InsertOtp(MongoConn *mongo.Database, colname string, otp OTP) (InsertedID interface{})

func InsertUserdata added in v0.2.0

func InsertUserdata(MongoConn *mongo.Database, user Users) (InsertedID interface{})

func InsertWageData added in v0.3.9

func InsertWageData(MongoConn *mongo.Database, wage WageCalc) (InsertedID interface{})

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

log User

func LoginAfterOTP added in v0.3.0

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

func LoginOTP added in v0.2.0

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

func MongoCreateConnection added in v0.2.0

func MongoCreateConnection(MongoString, dbname string) *mongo.Database

func RandStringBytes added in v0.2.0

func RandStringBytes(n int) string

func Register

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

reg User

func ResetPassword added in v0.0.16

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

Reset Password

func UpdateDataEmployees added in v0.0.6

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

Update data

func UpdateEmployee added in v0.0.6

func UpdateEmployee(Mongoconn *mongo.Database, ctx context.Context, emp Employee) (UpdateId interface{}, err error)

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"`
	Username   string   `json:"username" bson:"username"`
	Email      string   `json:"email" bson:"email,omitempty"`
	Phone      string   `json:"phone" bson:"phone,omitempty"`
	Division   Division `json:"division" bson:"division,omitempty"`
	Salary     Salary   `json:"salary" bson:"salary"`
}

func GetAllEmployeeData added in v0.1.0

func GetAllEmployeeData(Mongoconn *mongo.Database, colname string) []Employee

func GetOneEmployeeData added in v0.1.4

func GetOneEmployeeData(mongoconn *mongo.Database, colname, Empid string) (dest Employee)

type Logindata added in v0.2.3

type Logindata struct {
	Username string `json:"username" bson:"username"`
	Password string `json:"password" bson:"password"`
}

type OTP added in v0.2.0

type OTP struct {
	Username string    `json:"username" bson:"username"`
	Role     string    `bson:"role" json:"role"`
	DateOTP  time.Time `json:"date-otp" bson:"date-otp"`
	OTPCode  string    `bson:"otp-code" json:"otp-code"`
}

func GetOtp added in v0.2.0

func GetOtp(mongoconn *mongo.Database, colname, otp string) (dest OTP)

type OnlyOTP added in v0.3.0

type OnlyOTP struct {
	OTPCode string `bson:"otp-code" json:"otp-code"`
}

type ReqUsers added in v0.0.15

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

type RequestEmployee added in v0.1.1

type RequestEmployee struct {
	EmployeeId string `json:"employeeid"`
}

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 ResponseEmployeeBanyak added in v0.1.0

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

type Responses added in v0.2.0

type Responses struct {
	Response string `bson:"response" json:"response"`
}

type Salary added in v0.1.0

type Salary struct {
	BasicSalary   int `bson:"basic-salary" json:"basic-salary"`
	HonorDivision int `bson:"honor-division" json:"honor-division"`
}

type Updated added in v0.0.6

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

type Users added in v0.2.0

type Users struct {
	Username string `json:"username" bson:"username"`
	Password string `json:"password" bson:"password"`
	PhoneNum string `json:"phone-num" bson:"phoneNum"`
	Role     string `json:"role,omitempty" bson:"role,omitempty"`
}

func GetOneUser added in v0.2.0

func GetOneUser(MongoConn *mongo.Database, colname string, userdata Users) Users

type WageCalc added in v0.3.8

type WageCalc struct {
	EmployeeName    string  `bson:"employeeName" json:"employeeName"`
	JumlahCommit    float64 `bson:"jumlahCommit" json:"jumlahCommit"`
	BasicSalary     float64 `bson:"basicSalary" json:"basicSalary"`
	HonorDivision   float64 `bson:"honorDivision" json:"honorDivision"`
	InsentifCommits float64 `json:"insentifCommits" bson:"insentifCommits"`
	GrossSalary     float64 `bson:"jumlahKotor" json:"jumlahKotor"`
	Tax             float64 `json:"tax" bson:"tax"`
	NettSalary      float64 `bson:"nettSalary" json:"nettSalary"`
	Month           string  `json:"month" bson:"month"`
}

func GetWgeAll added in v0.4.2

func GetWgeAll(MongoConn *mongo.Database) []WageCalc

Jump to

Keyboard shortcuts

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