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:
parent
322b265d7a
commit
6b360d08c1
25 changed files with 1254 additions and 331 deletions
23
middleware/middleware.go
Normal file
23
middleware/middleware.go
Normal 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}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue