Documentation ¶
Index ¶
- Constants
- func InitHTTPHandler(router *mux.Router, customerSession *middleware.CustomerSession, ...)
- type ChangeEmailEvent
- type ChangeEmailRequest
- type ChangeEmailResponse
- type ChangeEmailVerificationRequest
- type ChangePasswordRequest
- type Customer
- type CustomerRepository
- type CustomerUseCase
- type CustomerUseCaseProperty
- type GetProfileResponse
- type HTTPHandler
- func (handler HTTPHandler) ChangeEmail(w http.ResponseWriter, r *http.Request)
- func (handler HTTPHandler) ChangePassword(w http.ResponseWriter, r *http.Request)
- func (handler HTTPHandler) GetProfile(w http.ResponseWriter, r *http.Request)
- func (handler HTTPHandler) SignIn(w http.ResponseWriter, r *http.Request)
- func (handler HTTPHandler) SignOut(w http.ResponseWriter, r *http.Request)
- func (handler HTTPHandler) SignUp(w http.ResponseWriter, r *http.Request)
- func (handler HTTPHandler) UpdateProfile(w http.ResponseWriter, r *http.Request)
- func (handler HTTPHandler) Verify(w http.ResponseWriter, r *http.Request)
- func (handler HTTPHandler) VerifyChangeEmail(w http.ResponseWriter, r *http.Request)
- type SignInRequest
- type SignInResponse
- type SignUpEvent
- type SignUpRequest
- type SignUpResponse
- type UpdateProfileRequest
- type VerifyRequest
Constants ¶
View Source
const ( VerificationURLPath = "/v1/customerapp/customers/verify" ChangeEmailVerificationURLPath = "/v1/customerapp/customers/verify-change-email" VerficationStatusVerified = "VERIFIED" VerificationStatusUnverified = "UNVERIFIED" MemberStatusActive = "ACTIVE" MemberStatusInactive = "INACTIVE" )
Variables ¶
This section is empty.
Functions ¶
func InitHTTPHandler ¶
func InitHTTPHandler(router *mux.Router, customerSession *middleware.CustomerSession, validate *validator.Validate, customerUseCase CustomerUseCase)
Types ¶
type ChangeEmailEvent ¶
type ChangeEmailRequest ¶
type ChangeEmailRequest struct {
Email string `json:"email" validate:"email"`
}
type ChangeEmailResponse ¶
type ChangeEmailVerificationRequest ¶
type ChangeEmailVerificationRequest struct {
Token string
}
type ChangePasswordRequest ¶
type CustomerRepository ¶
type CustomerRepository interface { Save(ctx context.Context, c Customer, tx *sql.Tx) (int64, error) FindByID(ctx context.Context, ID int64, tx *sql.Tx) (Customer, error) FindByEmail(ctx context.Context, email string, tx *sql.Tx) (Customer, error) Update(ctx context.Context, ID int64, update Customer, tx *sql.Tx) error }
func NewCustomerRepository ¶
func NewCustomerRepository(logger *logrus.Logger, db *sql.DB) CustomerRepository
type CustomerUseCase ¶
type CustomerUseCase interface { SignUp(ctx context.Context, req SignUpRequest) (SignUpResponse, error) SignIn(ctx context.Context, req SignInRequest) (SignInResponse, error) SignOut(ctx context.Context) error GetProfile(ctx context.Context) (GetProfileResponse, error) UpdateProfile(ctx context.Context, req UpdateProfileRequest) error ChangeEmail(ctx context.Context, req ChangeEmailRequest) (ChangeEmailResponse, error) ChangePassword(ctx context.Context, req ChangePasswordRequest) error Verify(ctx context.Context, req VerifyRequest) error VerifyChangeEmail(ctx context.Context, req ChangeEmailVerificationRequest) error }
func NewCustomerUseCase ¶
func NewCustomerUseCase(props CustomerUseCaseProperty) CustomerUseCase
type CustomerUseCaseProperty ¶
type GetProfileResponse ¶
type HTTPHandler ¶
type HTTPHandler struct { SessionMiddleware *middleware.AdminSession Validate *validator.Validate CustomerUseCase CustomerUseCase }
func (HTTPHandler) ChangeEmail ¶
func (handler HTTPHandler) ChangeEmail(w http.ResponseWriter, r *http.Request)
func (HTTPHandler) ChangePassword ¶
func (handler HTTPHandler) ChangePassword(w http.ResponseWriter, r *http.Request)
func (HTTPHandler) GetProfile ¶
func (handler HTTPHandler) GetProfile(w http.ResponseWriter, r *http.Request)
func (HTTPHandler) SignIn ¶
func (handler HTTPHandler) SignIn(w http.ResponseWriter, r *http.Request)
func (HTTPHandler) SignOut ¶
func (handler HTTPHandler) SignOut(w http.ResponseWriter, r *http.Request)
func (HTTPHandler) SignUp ¶
func (handler HTTPHandler) SignUp(w http.ResponseWriter, r *http.Request)
func (HTTPHandler) UpdateProfile ¶
func (handler HTTPHandler) UpdateProfile(w http.ResponseWriter, r *http.Request)
func (HTTPHandler) Verify ¶
func (handler HTTPHandler) Verify(w http.ResponseWriter, r *http.Request)
func (HTTPHandler) VerifyChangeEmail ¶
func (handler HTTPHandler) VerifyChangeEmail(w http.ResponseWriter, r *http.Request)
type SignInRequest ¶
type SignInResponse ¶
type SignUpEvent ¶
type SignUpRequest ¶
type SignUpResponse ¶
type UpdateProfileRequest ¶
type UpdateProfileRequest struct {
Name string `json:"name"`
}
type VerifyRequest ¶
type VerifyRequest struct {
Token string
}
Click to show internal directories.
Click to hide internal directories.