2017-11-20 06:10:04 +01: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-01-03 07:04:48 +01:00
|
|
|
package ui
|
2017-11-20 06:10:04 +01:00
|
|
|
|
|
|
|
import (
|
2018-04-30 01:35:04 +02:00
|
|
|
"github.com/gorilla/mux"
|
2017-12-13 06:48:13 +01:00
|
|
|
"github.com/miniflux/miniflux/config"
|
2018-04-30 01:35:04 +02:00
|
|
|
"github.com/miniflux/miniflux/locale"
|
2017-12-13 06:48:13 +01:00
|
|
|
"github.com/miniflux/miniflux/reader/feed"
|
|
|
|
"github.com/miniflux/miniflux/scheduler"
|
|
|
|
"github.com/miniflux/miniflux/storage"
|
2018-04-30 01:35:04 +02:00
|
|
|
"github.com/miniflux/miniflux/template"
|
2017-11-20 06:10:04 +01:00
|
|
|
)
|
|
|
|
|
2017-11-22 07:36:00 +01:00
|
|
|
// Controller contains all HTTP handlers for the user interface.
|
2017-11-20 06:10:04 +01:00
|
|
|
type Controller struct {
|
2017-11-23 07:22:33 +01:00
|
|
|
cfg *config.Config
|
2017-11-20 06:10:04 +01:00
|
|
|
store *storage.Storage
|
2017-11-22 07:36:00 +01:00
|
|
|
pool *scheduler.WorkerPool
|
2017-11-20 06:10:04 +01:00
|
|
|
feedHandler *feed.Handler
|
2018-04-30 01:35:04 +02:00
|
|
|
tpl *template.Engine
|
|
|
|
router *mux.Router
|
|
|
|
translator *locale.Translator
|
2017-11-20 06:10:04 +01:00
|
|
|
}
|
|
|
|
|
2017-11-22 07:36:00 +01:00
|
|
|
// NewController returns a new Controller.
|
2018-04-30 01:35:04 +02:00
|
|
|
func NewController(cfg *config.Config, store *storage.Storage, pool *scheduler.WorkerPool, feedHandler *feed.Handler, tpl *template.Engine, translator *locale.Translator, router *mux.Router) *Controller {
|
2017-11-20 06:10:04 +01:00
|
|
|
return &Controller{
|
2017-11-23 07:22:33 +01:00
|
|
|
cfg: cfg,
|
2017-11-20 06:10:04 +01:00
|
|
|
store: store,
|
2017-11-22 07:36:00 +01:00
|
|
|
pool: pool,
|
2017-11-20 06:10:04 +01:00
|
|
|
feedHandler: feedHandler,
|
2018-04-30 01:35:04 +02:00
|
|
|
tpl: tpl,
|
|
|
|
translator: translator,
|
|
|
|
router: router,
|
2017-11-20 06:10:04 +01:00
|
|
|
}
|
|
|
|
}
|