auth

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware added in v1.1.0

func AuthMiddleware(w http.ResponseWriter, r *http.Request) string

func AuthenticateRequest added in v1.1.0

func AuthenticateRequest(w http.ResponseWriter, req *http.Request) (string, bool)

func CheckPassword

func CheckPassword(password string, hash string) bool

func CreateToken

func CreateToken(claims map[string]interface{}) (string, error)

func GetAuthenticatedUser added in v1.1.0

func GetAuthenticatedUser(w http.ResponseWriter, r *http.Request) string

func HashPassword

func HashPassword(password string) string

func NewTokenAuth

func NewTokenAuth() *jwtauth.JWTAuth

func RegisterAdmin added in v1.3.0

func RegisterAdmin(email string, password string, firstName string, lastName string, token string) (model.Admin, error)

func RegisterDoctor added in v1.3.0

func RegisterDoctor(email string, password string, name string, firstname string, address AddressInput) (model.Doctor, error)

func RegisterPatient added in v1.3.0

func RegisterPatient(email string, password string) (model.Patient, error)

func VerifyToken

func VerifyToken(tokenString string) bool

Types

type AddressInput added in v1.3.2

type AddressInput struct {
	Street  string `json:"street"`
	ZipCode string `json:"zip_code"`
	Country string `json:"country"`
	City    string `json:"city"`
}

type AdminInput added in v1.3.0

type AdminInput struct {
	Password string `json:"password"`
	Name     string `json:"name"`
	LastName string `json:"last_name"`
	Email    string `json:"email"`
	Token    string `json:"token"`
}

type CreatePatientAccountResponse added in v1.3.0

type CreatePatientAccountResponse struct {
	Id   string
	Code int
	Err  error
}

func CreatePatientAccount added in v1.3.0

func CreatePatientAccount(email string) CreatePatientAccountResponse

type DoctorInput added in v1.3.0

type DoctorInput struct {
	Password  string       `jon:"password"`
	Email     string       `json:"email"`
	Name      string       `json:"name"`
	Firstname string       `json:"firstname"`
	Address   AddressInput `json:"address"`
}

type GetDoctorByIdResponse added in v1.4.0

type GetDoctorByIdResponse struct {
	Doctor model.Doctor
	Code   int
	Err    error
}

func GetDoctorById added in v1.4.0

func GetDoctorById(id string) GetDoctorByIdResponse

type GetDoctorsResponse added in v1.4.0

type GetDoctorsResponse struct {
	Doctors []model.Doctor
	Code    int
	Err     error
}

func GetDoctors added in v1.4.0

func GetDoctors() GetDoctorsResponse

type LoginInput

type LoginInput struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginResponse added in v1.3.0

type LoginResponse struct {
	Token string
	Code  int
	Err   error
}

func Login

func Login(input LoginInput, t string) LoginResponse

type MissingPasswordResponse added in v1.3.0

type MissingPasswordResponse struct {
	Code int
	Err  error
}

func MissingPassword added in v1.3.0

func MissingPassword(email string) MissingPasswordResponse

type PatientInput added in v1.3.0

type PatientInput struct {
	Password string `json:"password"`
	Email    string `json:"email"`
}

type RegisterAndLoginResponse added in v1.3.0

type RegisterAndLoginResponse struct {
	Token string
	Code  int
	Err   error
}

func RegisterAndLoginAdmin added in v1.3.0

func RegisterAndLoginAdmin(email string, password string, firstName string, lastName string, token string) RegisterAndLoginResponse

func RegisterAndLoginDoctor added in v1.3.0

func RegisterAndLoginDoctor(email string, password string, name string, firstname string, address AddressInput) RegisterAndLoginResponse

func RegisterAndLoginPatient added in v1.3.0

func RegisterAndLoginPatient(email string, password string) RegisterAndLoginResponse

type ResetPasswordResponse added in v1.3.0

type ResetPasswordResponse struct {
	Code int
	Err  error
}

func ResetPassword added in v1.3.0

func ResetPassword(email string, password string, uuid string) ResetPasswordResponse

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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