view

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	All    = QuotesBase("All", []string{"quote.id ASC"})
	Latest = QuotesBase("Latest", []string{"quote.id DESC"})
	Search = QuotesBase("Search", []string{"quote.score DESC"})
	Top    = QuotesBase("Top", []string{"quote.score DESC"})
)

Functions

func Delete

func Delete(db model.Model, req *http.Request, r render.Render, params martini.Params)

func Index

func Index(r render.Render)

func Quote

func Quote(db model.Model, r render.Render, params martini.Params, isJson IsJson)

func QuotesBase

func QuotesBase(title string, orderBy []string) martini.Handler

func Random

func Random(db model.Model, r render.Render, req *http.Request, isJson IsJson)

func RenderError

func RenderError(r render.Render, code int, isJson IsJson, errorMessage string)

func Status

func Status(r render.Render)

func Submit

func Submit(db model.Model, r render.Render)

func SubmitForm

func SubmitForm(db model.Model, r render.Render, request *http.Request)

func Vote

func Vote(db model.Model, req *http.Request, r render.Render, params martini.Params)

Types

type ErrorEnv

type ErrorEnv struct {
	ErrorMessage string `json:"error_message"`
}

type ErrorPageEnv

type ErrorPageEnv struct {
	PageEnv
	ErrorEnv
}

type IsJson

type IsJson bool

type PageEnv

type PageEnv struct {
	Title string
	Query string
}

Jump to

Keyboard shortcuts

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