controller

package
v0.0.0-...-22f264f Latest Latest
Warning

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

Go to latest
Published: May 3, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Bootstrap class
	FlashError   = "alert-danger"
	FlashSuccess = "alert-success"
	FlashNotice  = "alert-info"
	FlashWarning = "alert-warning"
)

Functions

func AuthenticateUser

func AuthenticateUser(w http.ResponseWriter, r *http.Request)

func Configure

func Configure(vi View)

Configure sets the view information

func DeleteMeeting

func DeleteMeeting(w http.ResponseWriter, r *http.Request)

DeleteMeeting handles the meeting deletion

func Error404

func Error404(w http.ResponseWriter, r *http.Request)

Error404 handles 404 - Page Not Found

func Error500

func Error500(w http.ResponseWriter, r *http.Request)

Error500 handles 500 - Internal Server Error

func FileTime

func FileTime(name string) (string, error)

FileTime returns the modification time of the file

func Home

func Home(w http.ResponseWriter, r *http.Request)

func InvalidToken

func InvalidToken(w http.ResponseWriter, r *http.Request)

InvalidToken handles CSRF attacks

func LoadPlugins

func LoadPlugins(fms ...template.FuncMap)

LoadPlugins will combine all template.FuncMaps into one map and then set the plugins for the templates overwrite previous = true

func LoadTemplates

func LoadTemplates(rootTemp string, childTemps []string)

func Login

func Login(w http.ResponseWriter, r *http.Request)

func Logout

func Logout(w http.ResponseWriter, r *http.Request)

func MeetingIndex

func MeetingIndex(w http.ResponseWriter, r *http.Request)

MeetingpadReadGET displays the meetings in the meetingpad

func NewMeeting

func NewMeeting(w http.ResponseWriter, r *http.Request)

func Register

func Register(w http.ResponseWriter, r *http.Request)

func Repopulate

func Repopulate(list []string, src url.Values, dst map[string]interface{})

Repopulate updates the dst map so the form fields can be refilled

func SaveMeeting

func SaveMeeting(w http.ResponseWriter, r *http.Request)

func SaveUser

func SaveUser(w http.ResponseWriter, r *http.Request)

func Static

func Static(w http.ResponseWriter, r *http.Request)

Static maps static files

func UpdateMeeting

func UpdateMeeting(w http.ResponseWriter, r *http.Request)

UpdateMeeting displays the meeting update page

func Validate

func Validate(req *http.Request, required []string) (bool, string)

Validate returns true if all the required form values are passed

Types

type Flash

type Flash struct {
	Message string
	Class   string
}

Flash Message

type Template

type Template struct {
	Root     string   `json:"Root"`
	Children []string `json:"Children"`
}

Template root and children

type View

type View struct {
	BaseURI   string
	Extension string
	Folder    string
	Name      string
	Caching   bool
	Vars      map[string]interface{}
	// contains filtered or unexported fields
}

View attributes

func NewView

func NewView(req *http.Request) *View

New returns a new view

func ReadConfig

func ReadConfig() View

ReadConfig returns the configuration

func (*View) AssetTimePath

func (v *View) AssetTimePath(s string) (string, error)

AssetTimePath returns a URL with the proper base uri and timestamp appended. Works for CSS and JS assets Determines if local or on the web

func (*View) PrependBaseURI

func (v *View) PrependBaseURI(s string) string

PrependBaseURI prepends the base URI to the string

func (*View) Render

func (v *View) Render(w http.ResponseWriter)

Render renders a template to the writer

func (*View) RenderSingle

func (v *View) RenderSingle(w http.ResponseWriter)

RenderSingle renders a template to the writer

func (*View) SendFlashes

func (v *View) SendFlashes(w http.ResponseWriter)

SendFlashes allows retrieval of flash messages for using with Ajax

Jump to

Keyboard shortcuts

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