forked from goburrow/melon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
application.go
38 lines (31 loc) · 938 Bytes
/
application.go
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
package gomelon
import (
"github.com/goburrow/gomelon/core"
)
// Application is the default gomelon application which supports server command.
type Application struct {
// Name of the application
name string
configuration interface{}
}
// Application implements core.Application interface.
var _ core.Application = (*Application)(nil)
func (app *Application) Name() string {
if app.name == "" {
app.name = "gomelon-app"
}
return app.name
}
func (app *Application) SetName(name string) {
app.name = name
}
// Initializes the application bootstrap.
func (app *Application) Initialize(bootstrap *core.Bootstrap) {
bootstrap.AddCommand(&CheckCommand{})
bootstrap.AddCommand(&ServerCommand{})
}
// When the application runs, this is called after the Bundles are run.
// Override it to add handlers, tasks, etc. for your application.
func (app *Application) Run(interface{}, *core.Environment) error {
return nil
}