diff --git a/guardian/guardian.go b/guardian/guardian.go new file mode 100644 index 0000000..6fd6538 --- /dev/null +++ b/guardian/guardian.go @@ -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) +}