controllers

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultName is
	DefaultName = "Admin"
	// DefaultRole is
	DefaultRole = "admin"
	// DefaultUsername is
	DefaultUsername = "admin"
	// DefaultPassword is
	DefaultPassword = "admin"
)

Variables

This section is empty.

Functions

func InitDB

func InitDB()

InitDB is

Types

type App

type App struct {
	GormController
	CurrentUser *models.User
}

App is

type BlogUser

type BlogUser struct {
	App
}

User is

func (BlogUser) CheckUser

func (ctrl BlogUser) CheckUser() revel.Result

CheckUser is

func (BlogUser) CreateSession

func (ctrl BlogUser) CreateSession(username, password string) revel.Result

CreateSession is

func (BlogUser) DestroySession

func (ctrl BlogUser) DestroySession() revel.Result

DestroySession is

func (BlogUser) Edit

func (ctrl BlogUser) Edit() revel.Result

Edit is

func (BlogUser) Login

func (ctrl BlogUser) Login() revel.Result

Login is

func (BlogUser) Update

func (ctrl BlogUser) Update(name, oldPassword, newPassword, newPasswordConfirm string) revel.Result

Update is

type Comment

type Comment struct {
	App
}

Comment is

func (Comment) CheckUser

func (ctrl Comment) CheckUser() revel.Result

CheckUser is

func (Comment) Create

func (ctrl Comment) Create(postID int, body, commenter string) revel.Result

Create is

func (Comment) Destroy

func (ctrl Comment) Destroy(postID, ID int) revel.Result

Destroy is

type GormController

type GormController struct {
	*revel.Controller
	Txn *gorm.DB
}

GormController is

func (*GormController) Begin

func (ctrl *GormController) Begin() revel.Result

Begin a transaction

func (*GormController) Commit

func (ctrl *GormController) Commit() revel.Result

Commit the transaction.

func (*GormController) Rollback

func (ctrl *GormController) Rollback() revel.Result

Rollback if it's still going (must have panicked).

type Home

type Home struct {
	App
}

Home is

func (Home) Example

func (ctrl Home) Example() string

Example is

func (Home) Index

func (ctrl Home) Index() revel.Result

Index is

type Post

type Post struct {
	App
}

Post is

func (Post) CheckUser

func (ctrl Post) CheckUser() revel.Result

CheckUser is

func (Post) Create

func (ctrl Post) Create(title, body string) revel.Result

Create is

func (Post) Destroy

func (ctrl Post) Destroy(ID int) revel.Result

Destroy is

func (Post) Edit

func (ctrl Post) Edit(ID int) revel.Result

Edit is

func (Post) Index

func (ctrl Post) Index() revel.Result

Index is

func (Post) New

func (ctrl Post) New() revel.Result

New is

func (Post) Show

func (ctrl Post) Show(ID int) revel.Result

Show is

func (Post) Update

func (ctrl Post) Update(ID int, title, body string) revel.Result

Update is

Jump to

Keyboard shortcuts

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