controller

package
v0.0.0-...-7e06a17 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderError

func RenderError(ctx context.Context, rw http.ResponseWriter, err error)

RenderError log the error and it writes the corresponding HTTP response.

Types

type MaponController

type MaponController interface {
	GetMaponInfo(rw http.ResponseWriter, r *http.Request)
}

MaponController implements HTTP controller for Mapon requests.

func NewMaponController

func NewMaponController(repo repository.MaponRepository) MaponController

NewMaponController creates a instance of MaponController.

type PagesController

type PagesController interface {
	StaticFiles(w http.ResponseWriter, r *http.Request)
	IndexPage(w http.ResponseWriter, r *http.Request)
	LoginPage(w http.ResponseWriter, r *http.Request)
}

PagesController impelements HTTP controller for web pages requests.

func NewPagesController

func NewPagesController(ssnsSvc service.SessionsService, tmplMngr template.Manager) PagesController

NewPagesController creates a new instance of PagesController.

type UserController

type UserController interface {
	// LoginUser logs in an user in the application
	LoginUser(rw http.ResponseWriter, r *http.Request)
	// LogoutUser logs out an user session in the application
	LogoutUser(rw http.ResponseWriter, r *http.Request)
	// RegisterUser creates a new user in the application then it logs it in
	RegisterUser(rw http.ResponseWriter, r *http.Request)
}

UserController implements an HTTP Controller for users endpoints.

func NewUserController

func NewUserController(userSvc service.UserService, securitySvc service.SessionsService) UserController

NewUserController creates a new instance of UserController.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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