controllers

package
v0.0.0-...-6812513 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2013 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mongodb implements simple mongodb connection wrapper

Index

Constants

This section is empty.

Variables

View Source
var (
	Session *mgo.Session
	Base    string
)

module variables

Functions

This section is empty.

Types

type AdminController

type AdminController struct {
	*revel.Controller
	MongoDbController
	UserController
}

func (AdminController) CheckContentExists

func (c AdminController) CheckContentExists(page_url string, collection string) (count int, err error)

func (AdminController) DelPages

func (c AdminController) DelPages(url string) (err error)

func (AdminController) GetAdminCreateContent

func (c AdminController) GetAdminCreateContent(content_type string) revel.Result

GET any of Admin Page

func (AdminController) GetAdminDeleteContent

func (c AdminController) GetAdminDeleteContent(content_type string, url string) revel.Result

TODO: add permissions check for deleting

func (AdminController) GetAdminListContent

func (c AdminController) GetAdminListContent(content_type string) revel.Result

func (AdminController) GetAdminListPages

func (c AdminController) GetAdminListPages() revel.Result

func (AdminController) GetAdminUpdateContent

func (c AdminController) GetAdminUpdateContent(content_type, url string) revel.Result

func (AdminController) GetAdminUpdatePage

func (c AdminController) GetAdminUpdatePage(url string) revel.Result

Create update page

func (AdminController) PostAdminCreateContent

func (c AdminController) PostAdminCreateContent(content_type string) revel.Result

POST create plain content

func (AdminController) PostAdminCreatePage

func (c AdminController) PostAdminCreatePage() revel.Result

func (AdminController) PostAdminUpdateContent

func (c AdminController) PostAdminUpdateContent(content_type string) revel.Result

func (AdminController) PostAdminUpdatePage

func (c AdminController) PostAdminUpdatePage() revel.Result

POST update plain pages

func (AdminController) SavePage

func (c AdminController) SavePage(p models.Page) (err error)

type Application

type Application struct {
	PageController
	UserController
}

func (Application) Index

func (c Application) Index() revel.Result

Test application

type MongoDbController

type MongoDbController struct {
	Host     string
	Port     string
	User     string
	Password string
	Base     string
	Url      string
	*revel.Controller
}

func (*MongoDbController) Connect

func (c *MongoDbController) Connect() revel.Result

Connect to mongodb

func (*MongoDbController) Disconnect

func (c *MongoDbController) Disconnect() revel.Result

Connect to mongodb

func (*MongoDbController) GetConfig

func (p *MongoDbController) GetConfig(config_string string, defaul string) (value string, found bool)

revel.Config.String wrapper

func (*MongoDbController) GetConnectionUrl

func (p *MongoDbController) GetConnectionUrl()

TODO: move constants to one file

type PageController

type PageController struct {
	*revel.Controller
	MongoDbController
	UserController
}

func (PageController) GetPage

func (c PageController) GetPage(url string) revel.Result

GET page

func (PageController) Index

func (c PageController) Index() revel.Result

Front page

type UserController

type UserController struct {
	*revel.Controller
	MongoDbController
}

userController uses for user validation and auth

func (UserController) GetLoginPage

func (c UserController) GetLoginPage() revel.Result

GET auth page

func (UserController) LoggedIn

func (c UserController) LoggedIn() (hasper bool)

Check is user logged in

func (UserController) Login

func (c UserController) Login(username, password string) revel.Result

func (UserController) Logout

func (c UserController) Logout() revel.Result

Jump to

Keyboard shortcuts

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