1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00
miniflux-v2/ui/controller.go

40 lines
1.2 KiB
Go
Raw Normal View History

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