controllers

package
v0.0.0-...-feb40e3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessForbidden

func AccessForbidden(c *gin.Context)

AccessForbidden handles Access Forbidden http code

func AdminGet

func AdminGet(c *gin.Context)

AdminGet handles GET /admin route

func AuthRequired

func AuthRequired(role string) gin.HandlerFunc

AuthRequired grants access to authenticated users with a 'role' role

func CartAdd

func CartAdd(c *gin.Context)

CartAdd handles POST /cart/add/:id route

func CartDelete

func CartDelete(c *gin.Context)

CartDelete handles POST /cart/delete/:id route

func CartGet

func CartGet(c *gin.Context)

CartGet handles GET /cart route

func CartProcess

func CartProcess(c *gin.Context)

CartProcess handles POST /cart/process route

func CategoryCreate

func CategoryCreate(c *gin.Context)

CategoryCreate handles POST /admin/new_category route

func CategoryDelete

func CategoryDelete(c *gin.Context)

CategoryDelete handles POST /admin/categories/:id/delete route

func CategoryEdit

func CategoryEdit(c *gin.Context)

CategoryEdit handles GET /admin/categories/:id/edit route

func CategoryGet

func CategoryGet(c *gin.Context)

CategoryGet handles GET /c/:slug route

func CategoryIndex

func CategoryIndex(c *gin.Context)

CategoryIndex handles GET /admin/categories route

func CategoryNew

func CategoryNew(c *gin.Context)

CategoryNew handles GET /admin/new_category route

func CategoryUpdate

func CategoryUpdate(c *gin.Context)

CategoryUpdate handles POST /admin/categories/:id/edit route

func ContextData

func ContextData() gin.HandlerFunc

ContextData stores in gin context the common data, such as user info...

func CreateXMLSitemap

func CreateXMLSitemap()

CreateXMLSitemap creates xml sitemap for search engines, and saves in public/sitemap folder

func DefaultH

func DefaultH(c *gin.Context) gin.H

DefaultH returns common to all pages template data

func HomeGet

func HomeGet(c *gin.Context)

HomeGet handles GET / route

func ImageCreate

func ImageCreate(c *gin.Context)

ImageCreate handles POST /admin/new_image route

func ImageDelete

func ImageDelete(c *gin.Context)

ImageDelete handles POST /admin/images/:id/delete route

func InternalError

func InternalError(c *gin.Context)

InternalError handles Internal Server Error http code

func LoadTemplates

func LoadTemplates(router *gin.Engine)

LoadTemplates loads templates from views directory to gin engine

func ManageGet

func ManageGet(c *gin.Context)

ManageGet handles GET /:role/manage route

func ManagePost

func ManagePost(c *gin.Context)

ManagePost handles POST /:role/manage route, updates user credentials

func MenuCreate(c *gin.Context)

MenuCreate handles POST /admin/new_menu route

func MenuDelete(c *gin.Context)

MenuDelete handles POST /admin/menu/:id/delete route

func MenuEdit(c *gin.Context)

MenuEdit handles GET /admin/menu/:id/edit route

func MenuIndex(c *gin.Context)

MenuIndex handles GET /admin/menus route

func MenuItemCreate(c *gin.Context)

MenuItemCreate handles POST /admin/menu/:id/new_item route

func MenuItemDelete(c *gin.Context)

MenuItemDelete handles POST /admin/menu/:id/delete/:itemid route

func MenuItemEdit(c *gin.Context)

MenuItemEdit handles GET /admin/menu/:id/edit/:itemid route

func MenuItemIndex(c *gin.Context)

MenuItemIndex handles GET /admin/menu/:id route

func MenuItemNew(c *gin.Context)

MenuItemNew handles GET /admin/menu/:id/new_item route

func MenuItemUpdate(c *gin.Context)

MenuItemUpdate handles POST /admin/menu/:id/edit/:itemid route

func MenuNew(c *gin.Context)

MenuNew handles GET /admin/new_menu route

func MenuUpdate(c *gin.Context)

MenuUpdate handles POST /admin/menu/:id/edit route

func MethodNotAllowed

func MethodNotAllowed(c *gin.Context)

MethodNotAllowed handles gin MethodNotAllowed error

func NotFound

func NotFound(c *gin.Context)

NotFound handles gin NotFound error

func OrderConfirm

func OrderConfirm(c *gin.Context)

OrderConfirm handles GET /confirm_order/:id route

func OrderConsultPost

func OrderConsultPost(c *gin.Context)

OrderConsultPost handles GET /orderconsult route

func OrderCreate

func OrderCreate(c *gin.Context)

OrderCreate handles POST /new_order route

func OrderDelete

func OrderDelete(c *gin.Context)

OrderDelete handles POST /admin/orders/:id/delete route

func OrderGet

func OrderGet(c *gin.Context)

OrderGet handles GET /admin/orders/:id route

func OrderIndex

func OrderIndex(c *gin.Context)

OrderIndex handles GET /admin/orders route

func OrderNew

func OrderNew(c *gin.Context)

OrderNew handles GET /new_order route

func PageCreate

func PageCreate(c *gin.Context)

PageCreate handles POST /admin/new_page route

func PageDelete

func PageDelete(c *gin.Context)

PageDelete handles POST /admin/pages/:id/delete route

func PageEdit

func PageEdit(c *gin.Context)

PageEdit handles GET /admin/pages/:id/edit route

func PageGet

func PageGet(c *gin.Context)

PageGet handles GET /pages/:id route

func PageIndex

func PageIndex(c *gin.Context)

PageIndex handles GET /admin/pages route

func PageNew

func PageNew(c *gin.Context)

PageNew handles GET /admin/new_page route

func PageUpdate

func PageUpdate(c *gin.Context)

PageUpdate handles POST /admin/pages/:id/edit route

func ProductCreate

func ProductCreate(c *gin.Context)

ProductCreate handles POST /admin/new_product route

func ProductDelete

func ProductDelete(c *gin.Context)

ProductDelete handles POST /admin/products/:id/delete route

func ProductEdit

func ProductEdit(c *gin.Context)

ProductEdit handles GET /admin/products/:id/edit route

func ProductGet

func ProductGet(c *gin.Context)

ProductGet handles GET /p/:slug route

func ProductIndex

func ProductIndex(c *gin.Context)

ProductIndex handles GET /admin/products route

func ProductNew

func ProductNew(c *gin.Context)

ProductNew handles GET /admin/new_product route

func ProductUpdate

func ProductUpdate(c *gin.Context)

ProductUpdate handles POST /admin/products/:id/edit route

func RssGet

func RssGet(c *gin.Context)

RssGet handles GET /rss route

func SearchGet

func SearchGet(c *gin.Context)

SearchGet handles GET /search?search= route

func SettingCreate

func SettingCreate(c *gin.Context)

SettingCreate handles POST /admin/new_setting route

func SettingDelete

func SettingDelete(c *gin.Context)

SettingDelete handles POST /admin/settings/:id/delete route

func SettingEdit

func SettingEdit(c *gin.Context)

SettingEdit handles GET /admin/settings/:id/edit route

func SettingIndex

func SettingIndex(c *gin.Context)

SettingIndex handles GET /admin/settings route

func SettingNew

func SettingNew(c *gin.Context)

SettingNew handles GET /admin/new_setting route

func SettingUpdate

func SettingUpdate(c *gin.Context)

SettingUpdate handles POST /admin/settings/:id/edit route

func ShowErrorPage

func ShowErrorPage(c *gin.Context, code int, err error)

ShowErrorPage executes error template given its code

func SignInGet

func SignInGet(c *gin.Context)

SignInGet handles GET /signin route

func SignInPost

func SignInPost(c *gin.Context)

SignInPost handles POST /signin route, authenticates user

func SignUpEnabled

func SignUpEnabled() bool

SignUpEnabled returns true if sign up is enabled by config

func SignUpGet

func SignUpGet(c *gin.Context)

SignUpGet handles GET /signup route

func SignUpPost

func SignUpPost(c *gin.Context)

SignUpPost handles POST /signup route, creates new user

func SignoutGet

func SignoutGet(c *gin.Context)

SignoutGet handles GET /signout route

func SlideCreate

func SlideCreate(c *gin.Context)

SlideCreate handles slide /admin/new_slide route

func SlideDelete

func SlideDelete(c *gin.Context)

SlideDelete handles slide /admin/slides/:id/delete route

func SlideEdit

func SlideEdit(c *gin.Context)

SlideEdit handles GET /admin/slides/:id/edit route

func SlideIndex

func SlideIndex(c *gin.Context)

SlideIndex handles GET /admin/slides route

func SlideNew

func SlideNew(c *gin.Context)

SlideNew handles GET /admin/new_slide route

func SlideUpdate

func SlideUpdate(c *gin.Context)

SlideUpdate handles slide /admin/slides/:id/edit route

func UploadPost

func UploadPost(c *gin.Context)

UploadPost handles POST /upload route

func UserCreate

func UserCreate(c *gin.Context)

UserCreate handles POST /admin/new_user route

func UserDelete

func UserDelete(c *gin.Context)

UserDelete handles POST /admin/users/:id/delete route

func UserEdit

func UserEdit(c *gin.Context)

UserEdit handles GET /admin/users/:id/edit route

func UserIndex

func UserIndex(c *gin.Context)

UserIndex handles GET /admin/users route

func UserNew

func UserNew(c *gin.Context)

UserNew handles GET /admin/new_user route

func UserUpdate

func UserUpdate(c *gin.Context)

UserUpdate handles POST /admin/users/:id/edit route

Types

type Breadcrumb struct {
	URL   string
	Title string
}

Breadcrumb represents a breadcrumb

type CartType

type CartType map[uint64]bool

CartType represents cart hash map, stored in session cookie

type Option

type Option struct {
	Value string
	Text  string
}

Option represents select option entry

Jump to

Keyboard shortcuts

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