app

package
v8.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Instance = NewApplication("My Awesome App", "kataras2006@hotmail.com")

Instance is our global application bootstrap instance.

Functions

func Boot

func Boot(runner iris.Runner, configurators ...iris.Configurator)

Boot starts our default instance appolication.

Types

type Application

type Application struct {
	*iris.Application

	Name      string
	Owner     string
	SpawnDate time.Time

	Sessions *sessions.Sessions
}

Application is our application wrapper and bootstrapper, keeps our settings.

func NewApplication

func NewApplication(name, owner string) *Application

NewApplication returns a new named Application.

func (*Application) SetupErrorHandlers

func (app *Application) SetupErrorHandlers()

SetupErrorHandlers prepares the http error handlers (>=400). Remember that error handlers in Iris have their own middleware ecosystem so the route's middlewares are not running when an http error happened. So if we want a logger we have to re-create one, here we will customize that logger as well.

func (*Application) SetupRouter

func (app *Application) SetupRouter()

SetupRouter registers the available routes from the "controllers" package.

func (*Application) SetupSessions

func (app *Application) SetupSessions(expires time.Duration, cookieHashKey, cookieBlockKey []byte)

SetupSessions initializes the sessions, optionally.

func (*Application) SetupViews

func (app *Application) SetupViews(viewsDir string)

SetupViews loads the templates.

Directories

Path Synopsis
controllers

Jump to

Keyboard shortcuts

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