middleware.go 615 B

1234567891011121314151617181920212223
  1. // Copyright 2018 Frédéric Guillot. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package middleware
  5. import (
  6. "github.com/gorilla/mux"
  7. "github.com/miniflux/miniflux/config"
  8. "github.com/miniflux/miniflux/storage"
  9. )
  10. // Middleware handles different middleware handlers.
  11. type Middleware struct {
  12. cfg *config.Config
  13. store *storage.Storage
  14. router *mux.Router
  15. }
  16. // New returns a new middleware.
  17. func New(cfg *config.Config, store *storage.Storage, router *mux.Router) *Middleware {
  18. return &Middleware{cfg, store, router}
  19. }