dnote/pkg/server/controllers/controllers.go
Sung Won Cho 5bba57fd29
Remove dependency on packr (#597)
* Embed files

* Build CLI

* Remove packr

* Embed view directory

* Embed static files

* Make view engine

* Populate build info
2022-05-09 20:34:23 +10:00

32 lines
610 B
Go

package controllers
import (
"github.com/dnote/dnote/pkg/server/app"
"github.com/dnote/dnote/pkg/server/views"
)
// Controllers is a group of controllers
type Controllers struct {
Users *Users
Notes *Notes
Books *Books
Sync *Sync
Static *Static
Health *Health
}
// New returns a new group of controllers
func New(app *app.App) *Controllers {
c := Controllers{}
viewEngine := views.NewDefaultEngine()
c.Users = NewUsers(app, viewEngine)
c.Notes = NewNotes(app)
c.Books = NewBooks(app)
c.Sync = NewSync(app)
c.Static = NewStatic(app, viewEngine)
c.Health = NewHealth(app)
return &c
}