Documentation
¶
Index ¶
- Constants
- func AdminLogin(env *HandlerConfig) http.HandlerFunc
- func ChangeAdminAccountPassword(env *HandlerConfig) http.HandlerFunc
- func ChangeEmployerAccountPassword(env *HandlerConfig) http.HandlerFunc
- func ChangeMyAdminAccountPassword(env *HandlerConfig) http.HandlerFunc
- func ChangeMyEmployerAccountPassword(env *HandlerConfig) http.HandlerFunc
- func CreateAdminAccount(env *HandlerConfig) http.HandlerFunc
- func CreateEmployer(env *HandlerConfig) http.HandlerFunc
- func CreateEmployerAccount(env *HandlerConfig) http.HandlerFunc
- func DeleteAdminAccount(env *HandlerConfig) http.HandlerFunc
- func DeleteEmployer(env *HandlerConfig) http.HandlerFunc
- func DeleteEmployerAccount(env *HandlerConfig) http.HandlerFunc
- func DeleteJobPost(env *HandlerConfig) http.HandlerFunc
- func EmployersLogin(env *HandlerConfig) http.HandlerFunc
- func GeneratePasswordHash(password string) (string, error)
- func GetAdminAccount(env *HandlerConfig) http.HandlerFunc
- func GetEmployer(env *HandlerConfig) http.HandlerFunc
- func GetEmployerAccount(env *HandlerConfig) http.HandlerFunc
- func GetJobPost(env *HandlerConfig) http.HandlerFunc
- func GetMyAdminAccount(env *HandlerConfig) http.HandlerFunc
- func GetMyEmployerAccount(env *HandlerConfig) http.HandlerFunc
- func GetStatus(env *HandlerConfig) http.HandlerFunc
- func ListAdminAccounts(env *HandlerConfig) http.HandlerFunc
- func ListEmployerAccounts(env *HandlerConfig) http.HandlerFunc
- func ListEmployers(env *HandlerConfig) http.HandlerFunc
- func ListJobPosts(env *HandlerConfig) http.HandlerFunc
- func Me(jwtSecret []byte, handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
- func New(port int, cert []byte, key []byte, dbQueries *db.Queries) (*http.Server, error)
- func NewLesVieuxRouter(config *HandlerConfig) http.Handler
- type ChangeAdminAccountPasswordParams
- type ChangeAdminAccountPasswordResponse
- type ChangeEmployerAccountPasswordParams
- type ChangeEmployerAccountPasswordResponse
- type CreateAdminAccountParams
- type CreateAdminAccountResponse
- type CreateEmployerAccountParams
- type CreateEmployerAccountResponse
- type CreateEmployerParams
- type CreateEmployerResponse
- type CreateJobPostResponse
- type EmployerLoginParams
- type EmployerLoginResponse
- type GetAdminAccountResponse
- type GetEmployerAccountResponse
- type GetEmployerResponse
- type GetJobPostResponse
- type GetStatusResponse
- type HandlerConfig
- type LoginParams
- type LoginResponse
- type UpdateJobPostParams
- type UpdateJobPostResponse
Constants ¶
const ( ApplicantRole int64 = 0 AdminRole int64 = 1 EmployerRole int64 = 2 )
const ClaimValidity = 1 * time.Hour
Variables ¶
This section is empty.
Functions ¶
func AdminLogin ¶
func AdminLogin(env *HandlerConfig) http.HandlerFunc
func ChangeAdminAccountPassword ¶
func ChangeAdminAccountPassword(env *HandlerConfig) http.HandlerFunc
func ChangeEmployerAccountPassword ¶
func ChangeEmployerAccountPassword(env *HandlerConfig) http.HandlerFunc
func ChangeMyAdminAccountPassword ¶
func ChangeMyAdminAccountPassword(env *HandlerConfig) http.HandlerFunc
func ChangeMyEmployerAccountPassword ¶
func ChangeMyEmployerAccountPassword(env *HandlerConfig) http.HandlerFunc
func CreateAdminAccount ¶
func CreateAdminAccount(env *HandlerConfig) http.HandlerFunc
CreateAdminAccount creates a new AdminAccount, and returns the id of the created row
func CreateEmployer ¶
func CreateEmployer(env *HandlerConfig) http.HandlerFunc
CreateEmployer creates a new Employer, and returns the id of the created row
func CreateEmployerAccount ¶
func CreateEmployerAccount(env *HandlerConfig) http.HandlerFunc
CreateEmployerAccount creates a new EmployerAccount, and returns the id of the created row
func DeleteAdminAccount ¶
func DeleteAdminAccount(env *HandlerConfig) http.HandlerFunc
DeleteAdminAccount handler receives an id as a path parameter, deletes the corresponding AdminAccount, and returns a http.StatusNoContent on success
func DeleteEmployer ¶
func DeleteEmployer(env *HandlerConfig) http.HandlerFunc
DeleteEmployer handler receives an id as a path parameter, deletes the corresponding Employer, and returns a http.StatusNoContent on success
func DeleteEmployerAccount ¶
func DeleteEmployerAccount(env *HandlerConfig) http.HandlerFunc
DeleteEmployerAccount handler receives an id as a path parameter, deletes the corresponding EmployerAccount, and returns a http.StatusNoContent on success
func DeleteJobPost ¶
func DeleteJobPost(env *HandlerConfig) http.HandlerFunc
func EmployersLogin ¶
func EmployersLogin(env *HandlerConfig) http.HandlerFunc
func GeneratePasswordHash ¶
func GetAdminAccount ¶
func GetAdminAccount(env *HandlerConfig) http.HandlerFunc
GetAdminAccount receives an id as a path parameter, and returns the corresponding AdminAccount
func GetEmployer ¶
func GetEmployer(env *HandlerConfig) http.HandlerFunc
GetEmployer receives an id as a path parameter, and returns the corresponding Employer
func GetEmployerAccount ¶
func GetEmployerAccount(env *HandlerConfig) http.HandlerFunc
GetEmployerAccount receives an id as a path parameter, and returns the corresponding EmployerAccount
func GetJobPost ¶
func GetJobPost(env *HandlerConfig) http.HandlerFunc
func GetMyAdminAccount ¶
func GetMyAdminAccount(env *HandlerConfig) http.HandlerFunc
func GetMyEmployerAccount ¶
func GetMyEmployerAccount(env *HandlerConfig) http.HandlerFunc
func GetStatus ¶
func GetStatus(env *HandlerConfig) http.HandlerFunc
func ListAdminAccounts ¶
func ListAdminAccounts(env *HandlerConfig) http.HandlerFunc
func ListEmployerAccounts ¶
func ListEmployerAccounts(env *HandlerConfig) http.HandlerFunc
func ListEmployers ¶
func ListEmployers(env *HandlerConfig) http.HandlerFunc
func ListJobPosts ¶
func ListJobPosts(env *HandlerConfig) http.HandlerFunc
func Me ¶
func Me(jwtSecret []byte, handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
func NewLesVieuxRouter ¶
func NewLesVieuxRouter(config *HandlerConfig) http.Handler
Types ¶
type ChangeAdminAccountPasswordParams ¶
type ChangeAdminAccountPasswordParams struct {
Password string `json:"password"`
}
type ChangeAdminAccountPasswordResponse ¶
type ChangeAdminAccountPasswordResponse struct {
ID int64 `json:"id"`
}
type ChangeEmployerAccountPasswordParams ¶
type ChangeEmployerAccountPasswordParams struct {
Password string `json:"password"`
}
type ChangeEmployerAccountPasswordResponse ¶
type ChangeEmployerAccountPasswordResponse struct {
ID int64 `json:"id"`
}
type CreateAdminAccountResponse ¶
type CreateAdminAccountResponse struct {
ID int64 `json:"id"`
}
type CreateEmployerAccountResponse ¶
type CreateEmployerAccountResponse struct {
ID int64 `json:"id"`
}
type CreateEmployerParams ¶
type CreateEmployerParams struct {
Name string `json:"name"`
}
type CreateEmployerResponse ¶
type CreateEmployerResponse struct {
ID int64 `json:"id"`
}
type CreateJobPostResponse ¶
type CreateJobPostResponse struct {
ID int64 `json:"id"`
}
type EmployerLoginParams ¶
type EmployerLoginResponse ¶
type EmployerLoginResponse struct {
Token string `json:"token"`
}
type GetAdminAccountResponse ¶
type GetEmployerResponse ¶
type GetJobPostResponse ¶
type GetStatusResponse ¶
type HandlerConfig ¶
type LoginParams ¶
type LoginResponse ¶
type LoginResponse struct {
Token string `json:"token"`
}
type UpdateJobPostParams ¶
type UpdateJobPostResponse ¶
type UpdateJobPostResponse struct {
ID int64 `json:"id"`
}
Source Files
¶
- handlers_admin_accounts.go
- handlers_admin_login.go
- handlers_employer_accounts.go
- handlers_employers.go
- handlers_employers_login.go
- handlers_frontend.go
- handlers_job_posts.go
- handlers_status.go
- middleware.go
- middleware_auth.go
- middleware_logging.go
- middleware_metrics.go
- password.go
- response.go
- router.go
- server.go