handlers

package
v0.0.0-...-0cd45ec Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandlers

func NewHandlers(r *Repository)

NewHandlers - sets repository for the handlers

Types

type Repository

type Repository struct {
	App *config.AppConfig
	DB  repository.DatabaseRepo
}

Repository holds the application configuration and specifies which type of database are we actually using.

var Repo *Repository

Repo the repository used by the handlers

func NewRepo

func NewRepo(a *config.AppConfig, db *driver.DB) *Repository

NewRepo creates a new repository

func NewTestingRepo

func NewTestingRepo(a *config.AppConfig) *Repository

NewTestingRepo creates a new testing DB repository

func (*Repository) ActivateUserAccount

func (m *Repository) ActivateUserAccount(w http.ResponseWriter, r *http.Request)

ActivateUserAccount handles inserting new user to the database

func (*Repository) ForgotPassword

func (m *Repository) ForgotPassword(w http.ResponseWriter, r *http.Request)

ForgotPassword handles rendering forgot password page.

func (*Repository) Home

func (m *Repository) Home(w http.ResponseWriter, r *http.Request)

Home handler - renders home page.

func (*Repository) PostSignIn

func (m *Repository) PostSignIn(w http.ResponseWriter, r *http.Request)

PostSignIn handles logging the user in.

func (*Repository) PostSignUp

func (m *Repository) PostSignUp(w http.ResponseWriter, r *http.Request)

PostSignUp handler - renders sign in page

func (*Repository) ResetPassword

func (m *Repository) ResetPassword(w http.ResponseWriter, r *http.Request)

ResetPassword handles updating user password

func (*Repository) SendPasswordResetEmail

func (m *Repository) SendPasswordResetEmail(w http.ResponseWriter, r *http.Request)

SendPasswordResetEmail handles sending link for reseting password via email

func (*Repository) ShowActivateUserAccount

func (m *Repository) ShowActivateUserAccount(w http.ResponseWriter, r *http.Request)

ShowActivateUserAccount handles rendering page when user visits link sent via his email for activating has account

func (*Repository) ShowAuth

func (m *Repository) ShowAuth(w http.ResponseWriter, r *http.Request)

func (*Repository) ShowResetPassword

func (m *Repository) ShowResetPassword(w http.ResponseWriter, r *http.Request)

ShowResetPassword handles rendering page for entering new password after clicking on reset link

func (*Repository) SignOut

func (m *Repository) SignOut(w http.ResponseWriter, r *http.Request)

SignOut handles user signing out

Jump to

Keyboard shortcuts

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