controllers

package
v0.0.0-...-f20b317 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	LocationDataView   *views.View
	LocationResultView *views.View
	SearchView         *views.View
	// contains filtered or unexported fields
}

func NewLocation

func NewLocation(ls models.LocationService) *Location

func (*Location) Create

func (l *Location) Create(w http.ResponseWriter, r *http.Request)

func (*Location) Delete

func (l *Location) Delete(w http.ResponseWriter, r *http.Request)

func (*Location) Home

func (l *Location) Home(w http.ResponseWriter, r *http.Request)

func (*Location) LocationData

func (l *Location) LocationData(w http.ResponseWriter, r *http.Request)

func (*Location) LocationResults

func (l *Location) LocationResults(w http.ResponseWriter, r *http.Request)

func (*Location) LocationSearch

func (l *Location) LocationSearch(w http.ResponseWriter, r *http.Request)

func (*Location) Routes

func (l *Location) Routes() chi.Router

type LoginForm

type LoginForm struct {
	Email    string `schema:"email"`
	Password string `schema:"password"`
}

type RegistrationForm

type RegistrationForm struct {
	Name     string `schema:"name"`
	Email    string `schema:"email"`
	Password string `schema:"password"`
}

type User

type User struct {
	LoginView    *views.View
	RegisterView *views.View
	// contains filtered or unexported fields
}

func NewUser

func NewUser(us models.UserService) *User

func (*User) AuthMiddleware

func (u *User) AuthMiddleware(next http.Handler) http.Handler

HTTP middleware setting a value on the request context

func (*User) Create

func (u *User) Create(w http.ResponseWriter, r *http.Request)

Create is used to process the registration form

POST /register

func (*User) GetUser

func (u *User) GetUser(w http.ResponseWriter, r *http.Request) *models.User

func (*User) Login

func (u *User) Login(w http.ResponseWriter, r *http.Request)

func (*User) LoginStatic

func (u *User) LoginStatic(w http.ResponseWriter, r *http.Request)

func (*User) Logout

func (u *User) Logout(w http.ResponseWriter, r *http.Request)

func (*User) RegisterStatic

func (u *User) RegisterStatic(w http.ResponseWriter, r *http.Request)

func (*User) Routes

func (u *User) Routes() chi.Router

Jump to

Keyboard shortcuts

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