app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

Application the ThinkGo Application

func NewApplication

func NewApplication() *Application

NewApplication returns a new ThinkGo Application

func (*Application) GetRoute

func (a *Application) GetRoute() *router.Route

GetRoute Get the router of the application

func (*Application) GetView

func (a *Application) GetView() *view.View

GetView Get the view of the application

func (*Application) RegisterRoute

func (a *Application) RegisterRoute(r *router.Route)

RegisterRoute Register Route for Application

func (*Application) RegisterView

func (a *Application) RegisterView(v *view.View)

RegisterView Register View for Application

type Closure

type Closure func(req *context.Request) interface{}

Closure Anonymous function, Used in Middleware Handler

type Handler

type Handler interface {
	Process(request *context.Request, next Closure) interface{}
}

Handler Middleware Handler interface

func NewRouteHandler

func NewRouteHandler(app *Application) Handler

NewRouteHandler The default RouteHandler

func NewSessionHandler

func NewSessionHandler(app *Application) Handler

SessionHandler The default SessionHandler

type HandlerFunc

type HandlerFunc func(app *Application) Handler

HandlerFunc Handle the application.

type RouteHandler

type RouteHandler struct {
	Route *router.Route
}

func (*RouteHandler) Process

func (h *RouteHandler) Process(request *context.Request, next Closure) interface{}

Process Process the request to a router and return the response.

type SessionHandler

type SessionHandler struct {
	// contains filtered or unexported fields
}

func (*SessionHandler) Process

func (h *SessionHandler) Process(req *context.Request, next Closure) interface{}

Jump to

Keyboard shortcuts

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