-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathapp.go
More file actions
41 lines (34 loc) · 880 Bytes
/
app.go
File metadata and controls
41 lines (34 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package thinkgo
import (
"github.com/go-think/think/contract"
"github.com/go-think/think/router"
"github.com/go-think/think/view"
)
// Application the ThinkGo Application
type Application struct {
Env string
Debug bool
Logger contract.Logger
view *view.View
route *router.Route
}
// NewApplication returns a new ThinkGo Application
func NewApplication() *Application {
return &Application{Env: "production"}
}
// RegisterRoute Register Route for Application
func (a *Application) RegisterRoute(r *router.Route) {
a.route = r
}
// RegisterView Register View for Application
func (a *Application) RegisterView(v *view.View) {
a.view = v
}
// GetRoute Get the router of the application
func (a *Application) GetRoute() *router.Route {
return a.route
}
// GetView Get the view of the application
func (a *Application) GetView() *view.View {
return a.view
}