Add placeholder middleware for guardian
This commit is contained in:
parent
5593efee37
commit
c2ff5ac1fa
1 changed files with 27 additions and 0 deletions
27
guardian/guardian.go
Normal file
27
guardian/guardian.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package guardian
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"gitlab.com/mstarongitlab/linstrom/config"
|
||||
"gitlab.com/mstarongitlab/linstrom/storage"
|
||||
)
|
||||
|
||||
type GuardianMiddleware struct {
|
||||
nextHandler http.Handler
|
||||
config *config.Config
|
||||
storage *storage.Storage
|
||||
}
|
||||
|
||||
func NewMiddleware(nextHandler http.Handler, cfg *config.Config, s *storage.Storage) *GuardianMiddleware {
|
||||
return &GuardianMiddleware{
|
||||
nextHandler: nextHandler,
|
||||
config: cfg,
|
||||
storage: s,
|
||||
}
|
||||
}
|
||||
|
||||
func (gm *GuardianMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// TODO: Add guardian filtering stuff here, see Planka
|
||||
gm.nextHandler.ServeHTTP(w, r)
|
||||
}
|
Loading…
Reference in a new issue