Documentation ¶
Index ¶
- func GenerateJWT() (string, error)
- type AuthHandler
- type AuthenticationIface
- type EmployeeHandler
- func (handler *EmployeeHandler) DeleteEmployee(w http.ResponseWriter, r *http.Request)
- func (handler *EmployeeHandler) GetEmployee(w http.ResponseWriter, r *http.Request)
- func (handler *EmployeeHandler) ListEmployees(w http.ResponseWriter, r *http.Request)
- func (handler *EmployeeHandler) PostEmployee(w http.ResponseWriter, r *http.Request)
- func (handler *EmployeeHandler) RestoreEmployeeStatus(w http.ResponseWriter, r *http.Request)
- func (handler *EmployeeHandler) SearchEmployee(w http.ResponseWriter, r *http.Request)
- func (handler *EmployeeHandler) UpdateEmployeeDetails(w http.ResponseWriter, r *http.Request)
- type EmployeeHandlerIface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthHandler ¶
type AuthHandler struct { }
AuthHandler handles all the operations related to the JWT Tokens
func NewAuthHandler ¶
func NewAuthHandler() *AuthHandler
NewAuthHandler returns a new instance of the Auth Handler
func (*AuthHandler) GenerateToken ¶
func (handler *AuthHandler) GenerateToken(w http.ResponseWriter, r *http.Request)
GenerateToken generates a new JWT Token
type AuthenticationIface ¶
type AuthenticationIface interface { GenerateToken(w http.ResponseWriter, r *http.Request) IsAuthorized(endpoint func(http.ResponseWriter, *http.Request)) http.Handler }
AuthenticationIface abstracts the functionlities on authentication handler
type EmployeeHandler ¶
type EmployeeHandler struct {
EmployeeService services.EmployeeServiceIface
}
EmployeeHandler handles all the operations related to the Employees
func NewEmployeeHandler ¶
func NewEmployeeHandler() *EmployeeHandler
NewEmployeeHandler returns a new instance of the EmployeeHandler
func (*EmployeeHandler) DeleteEmployee ¶
func (handler *EmployeeHandler) DeleteEmployee(w http.ResponseWriter, r *http.Request)
DeleteEmployee deletes/inactivates an employee
func (*EmployeeHandler) GetEmployee ¶
func (handler *EmployeeHandler) GetEmployee(w http.ResponseWriter, r *http.Request)
GetEmployee gets specific employee details
func (*EmployeeHandler) ListEmployees ¶
func (handler *EmployeeHandler) ListEmployees(w http.ResponseWriter, r *http.Request)
ListEmployees handler handles the bussiness logic for listing all the Employees
func (*EmployeeHandler) PostEmployee ¶
func (handler *EmployeeHandler) PostEmployee(w http.ResponseWriter, r *http.Request)
PostEmployee handler handles the bussiness logic for posting a new Employee
func (*EmployeeHandler) RestoreEmployeeStatus ¶
func (handler *EmployeeHandler) RestoreEmployeeStatus(w http.ResponseWriter, r *http.Request)
RestoreEmployeeStatus handles the bussiness logic for Restoring Soft deleted employee
func (*EmployeeHandler) SearchEmployee ¶
func (handler *EmployeeHandler) SearchEmployee(w http.ResponseWriter, r *http.Request)
SearchEmployee handles the bussiness logic for retrieving the list of employees based on a search query
func (*EmployeeHandler) UpdateEmployeeDetails ¶
func (handler *EmployeeHandler) UpdateEmployeeDetails(w http.ResponseWriter, r *http.Request)
UpdateEmployeeDetails handles the bussiness logic for Updating/deleting the EmployeeDetails
type EmployeeHandlerIface ¶
type EmployeeHandlerIface interface { SearchEmployee(w http.ResponseWriter, r *http.Request) PostEmployee(w http.ResponseWriter, r *http.Request) ListEmployees(w http.ResponseWriter, r *http.Request) UpdateEmployeeDetails(w http.ResponseWriter, r *http.Request) RestoreEmployeeStatus(w http.ResponseWriter, r *http.Request) GetEmployee(w http.ResponseWriter, r *http.Request) DeleteEmployee(w http.ResponseWriter, r *http.Request) }
EmployeeHandlerIface abstracts all the functionalities of the employees handler