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

Use Gorilla middleware (refactoring)

This commit is contained in:
Frédéric Guillot 2018-04-27 20:38:46 -07:00
parent 322b265d7a
commit 6b360d08c1
25 changed files with 1254 additions and 331 deletions

23
middleware/middleware.go Normal file
View file

@ -0,0 +1,23 @@
// Copyright 2018 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 middleware
import (
"github.com/gorilla/mux"
"github.com/miniflux/miniflux/config"
"github.com/miniflux/miniflux/storage"
)
// Middleware handles different middleware handlers.
type Middleware struct {
cfg *config.Config
store *storage.Storage
router *mux.Router
}
// New returns a new middleware.
func New(cfg *config.Config, store *storage.Storage, router *mux.Router) *Middleware {
return &Middleware{cfg, store, router}
}