1
0
Fork 0
miniflux/ui/controller.go

38 lines
1,018 B
Go
Raw Normal View History

2017-11-20 00:10:04 -05:00
// Copyright 2017 Frédéric Guillot. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
2018-08-25 00:51:50 -04:00
package ui // import "miniflux.app/ui"
2017-11-20 00:10:04 -05:00
import (
2018-08-25 00:51:50 -04:00
"miniflux.app/config"
"miniflux.app/reader/feed"
"miniflux.app/scheduler"
"miniflux.app/storage"
"miniflux.app/template"
2018-09-03 17:26:40 -04:00
"github.com/gorilla/mux"
2017-11-20 00:10:04 -05:00
)
// Controller contains all HTTP handlers for the user interface.
2017-11-20 00:10:04 -05:00
type Controller struct {
2017-11-23 01:22:33 -05:00
cfg *config.Config
2017-11-20 00:10:04 -05:00
store *storage.Storage
pool *scheduler.WorkerPool
2017-11-20 00:10:04 -05:00
feedHandler *feed.Handler
tpl *template.Engine
router *mux.Router
2017-11-20 00:10:04 -05:00
}
// NewController returns a new Controller.
func NewController(cfg *config.Config, store *storage.Storage, pool *scheduler.WorkerPool, feedHandler *feed.Handler, tpl *template.Engine, router *mux.Router) *Controller {
2017-11-20 00:10:04 -05:00
return &Controller{
2017-11-23 01:22:33 -05:00
cfg: cfg,
2017-11-20 00:10:04 -05:00
store: store,
pool: pool,
2017-11-20 00:10:04 -05:00
feedHandler: feedHandler,
tpl: tpl,
router: router,
2017-11-20 00:10:04 -05:00
}
}