controllers

package
v0.0.0-...-808fada Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPErrorHandler

func HTTPErrorHandler(err error, ctx echo.Context)

HTTPErrorHandler handle errors

func ManifestHandler

func ManifestHandler(ctx echo.Context) error

ManifestHandler handles the manifest

Types

type AuthController

type AuthController struct {
	UserService    *services.UserService
	ProfileService *services.ProfileService
}

AuthController auth controller

func NewAuthController

func NewAuthController(db *gorm.DB) *AuthController

NewAuthController creates a new AuthController

func (*AuthController) InitRoutes

func (c *AuthController) InitRoutes(g *echo.Group)

InitRoutes initialize routes for AuthController

type BoatContext

type BoatContext struct {
	echo.Context

	Server         *config.Server
	Session        *services.Session
	ProfileService *services.ProfileService
	MenuService    *services.MenuService
}

BoatContext custom echo Context for boat

func (*BoatContext) EnsureLoggedIn

func (bc *BoatContext) EnsureLoggedIn() error

EnsureLoggedIn ensures a user is logged in, throws error if not

func (*BoatContext) LoggedIn

func (bc *BoatContext) LoggedIn() bool

LoggedIn checks if a contexts session is logged in

func (*BoatContext) RedirectIfLoggedIn

func (bc *BoatContext) RedirectIfLoggedIn(path string) error

RedirectIfLoggedIn redirects to given path if logged in

func (*BoatContext) ReturnView

func (bc *BoatContext) ReturnView(code int, view string, data echo.Map) error

ReturnView renders a view, adding some data to the return

type CustomContextHandler

type CustomContextHandler struct {
	Server         *config.Server
	ProfileService *services.ProfileService
	MenuService    *services.MenuService
}

CustomContextHandler struct with a func for handling the custom context intjection

func NewCustomContextHandler

func NewCustomContextHandler(db *gorm.DB, s *config.Server) *CustomContextHandler

NewCustomContextHandler returns a new CustomContextHandler

func (*CustomContextHandler) Handler

Handler injects our custom context

type FilesController

type FilesController struct {
	FileService *services.FileService
}

FilesController routes for uploading and managing files

func NewFilesController

func NewFilesController(db *gorm.DB) *FilesController

NewFilesController returns a new FilesController

func (*FilesController) InitRoutes

func (c *FilesController) InitRoutes(g *echo.Group)

InitRoutes initialize routes for this controller

type MenuController struct {
	MenuService *services.MenuService
}

MenuController handlers for menu routes

func NewMenuController

func NewMenuController(db *gorm.DB) *MenuController

NewMenuController returns a new menu controller

func (c *MenuController) InitRoutes(g *echo.Group)

InitRoutes initialize routes for this controller

type PostsController

type PostsController struct {
	PostService *services.PostService
}

PostsController controller for posts

func NewPostsController

func NewPostsController(db *gorm.DB) *PostsController

NewPostsController creates a new PostsController

func (*PostsController) InitRoutes

func (c *PostsController) InitRoutes(g *echo.Group)

InitRoutes initialize routes for this controller

type ProfileController

type ProfileController struct {
	Service *services.ProfileService
}

ProfileController handles HTTP requests for the profile

func NewProfileController

func NewProfileController(db *gorm.DB) *ProfileController

NewProfileController returns a new ProfileController

func (*ProfileController) InitRoutes

func (c *ProfileController) InitRoutes(g *echo.Group)

InitRoutes initialize the routes for this controller

Jump to

Keyboard shortcuts

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