httptransport

package
v0.0.0-...-53e80a7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalDashboardResponse

func MarshalDashboardResponse(responseData *way_c.DashboardResponseIDO, w http.ResponseWriter)

func MarshalLoginResponse

func MarshalLoginResponse(responseData *gateway_s.LoginResponseIDO, w http.ResponseWriter)

func MarshalProfileResponse

func MarshalProfileResponse(responseData *gateway_c.ProfileResponse, w http.ResponseWriter)

func MarshalRefreshTokenResponse

func MarshalRefreshTokenResponse(accessToken string, accessTokenExpiryDate time.Time, refreshToken string, refreshTokenExpiryDate time.Time, u *user_s.User, w http.ResponseWriter)

func UnmarshalChangePasswordRequest

func UnmarshalChangePasswordRequest(ctx context.Context, r *http.Request) (*gate_c.ChangePasswordRequestIDO, error)

func UnmarshalExecutiveVisitsTenantRequest

func UnmarshalExecutiveVisitsTenantRequest(ctx context.Context, r *http.Request) (*gateway_c.ExecutiveVisitsTenantRequest, error)

func UnmarshalPasswordResetRequest

func UnmarshalPasswordResetRequest(ctx context.Context, r *http.Request) (*gate_c.PasswordResetRequestIDO, error)

func ValidateForgotPasswordRequest

func ValidateForgotPasswordRequest(dirtyData *ForgotPasswordRequestIDO) error

func ValidateLoginRequest

func ValidateLoginRequest(dirtyData *LoginRequestIDO) error

func ValidateRefreshTokenRequest

func ValidateRefreshTokenRequest(dirtyData *RefreshTokenRequestIDO) (bool, string)

Types

type ForgotPasswordRequestIDO

type ForgotPasswordRequestIDO struct {
	Email string `json:"email"`
}

func UnmarshalForgotPasswordRequest

func UnmarshalForgotPasswordRequest(ctx context.Context, r *http.Request) (*ForgotPasswordRequestIDO, error)

type GreetingRequest

type GreetingRequest struct {
	Name string `json:"name"`
}

type GreetingResponse

type GreetingResponse struct {
	Message string `json:"message"`
}

type Handler

type Handler struct {
	Logger     *slog.Logger
	Controller gateway_c.GatewayController
}

Handler Creates http request handler

func NewHandler

func NewHandler(loggerp *slog.Logger, c gateway_c.GatewayController) *Handler

NewHandler Constructor

func (*Handler) ChangePassword

func (h *Handler) ChangePassword(w http.ResponseWriter, r *http.Request)

func (*Handler) Dashboard

func (h *Handler) Dashboard(w http.ResponseWriter, r *http.Request)

func (*Handler) DisableOTP

func (h *Handler) DisableOTP(w http.ResponseWriter, r *http.Request)

func (*Handler) ExecutiveVisitsTenant

func (h *Handler) ExecutiveVisitsTenant(w http.ResponseWriter, r *http.Request)

func (*Handler) ForgotPassword

func (h *Handler) ForgotPassword(w http.ResponseWriter, r *http.Request)

func (*Handler) GenerateOTP

func (h *Handler) GenerateOTP(w http.ResponseWriter, r *http.Request)

func (*Handler) GenerateOTPAndQRCodePNGImage

func (h *Handler) GenerateOTPAndQRCodePNGImage(w http.ResponseWriter, r *http.Request)

func (*Handler) Greet

func (h *Handler) Greet(w http.ResponseWriter, r *http.Request)

PostGreet returns the greeting

func (*Handler) HealthCheck

func (h *Handler) HealthCheck(w http.ResponseWriter, r *http.Request)

Returns the status of the system.

func (*Handler) Login

func (h *Handler) Login(w http.ResponseWriter, r *http.Request)

func (*Handler) Logout

func (h *Handler) Logout(w http.ResponseWriter, r *http.Request)

func (*Handler) PasswordReset

func (h *Handler) PasswordReset(w http.ResponseWriter, r *http.Request)

func (*Handler) Profile

func (h *Handler) Profile(w http.ResponseWriter, r *http.Request)

func (*Handler) ProfileChangePassword

func (h *Handler) ProfileChangePassword(w http.ResponseWriter, r *http.Request)

func (*Handler) ProfileUpdate

func (h *Handler) ProfileUpdate(w http.ResponseWriter, r *http.Request)

func (*Handler) RecoveryOTP

func (h *Handler) RecoveryOTP(w http.ResponseWriter, r *http.Request)

func (*Handler) RefreshToken

func (h *Handler) RefreshToken(w http.ResponseWriter, r *http.Request)

func (*Handler) ValidateOTP

func (h *Handler) ValidateOTP(w http.ResponseWriter, r *http.Request)

func (*Handler) VerifyOTP

func (h *Handler) VerifyOTP(w http.ResponseWriter, r *http.Request)

func (*Handler) Version

func (h *Handler) Version(w http.ResponseWriter, r *http.Request)

Version returns the server version. Developers note, to see result you can run in your terminal `curl http://localhost:8000/api/v1/version`.

type LoginRequestIDO

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

func UnmarshalLoginRequest

func UnmarshalLoginRequest(ctx context.Context, r *http.Request) (*LoginRequestIDO, error)

type RefreshTokenRequestIDO

type RefreshTokenRequestIDO struct {
	Value string `json:"value"`
}

func UnmarshalRefreshTokenRequest

func UnmarshalRefreshTokenRequest(ctx context.Context, r *http.Request) (*RefreshTokenRequestIDO, error, int)

type RefreshTokenResponseIDO

type RefreshTokenResponseIDO struct {
	Email                  string    `json:"username"`
	AccessToken            string    `json:"access_token"`
	AccessTokenExpiryDate  time.Time `json:"access_token_expiry_date"`
	RefreshToken           string    `json:"refresh_token"`
	RefreshTokenExpiryDate time.Time `json:"refresh_token_expiry_date"`
}

RefreshTokenResponseIDO struct used to represent the system's response when the `login` POST request was a success.

Jump to

Keyboard shortcuts

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