1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-11 20:29:52 +00:00

Add dashboard to steve

This commit is contained in:
Darren Shepherd
2020-02-21 22:18:58 -07:00
parent c069f32bbe
commit 82c7877ba3
11 changed files with 478 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package responsewriter
import (
"net/http"
"github.com/gorilla/mux"
)
type MiddlewareChain struct {
middleWares []mux.MiddlewareFunc
}
func NewMiddlewareChain(middleWares ...mux.MiddlewareFunc) *MiddlewareChain {
return &MiddlewareChain{middleWares: middleWares}
}
func (m *MiddlewareChain) Handler(handler http.Handler) http.Handler {
rtn := handler
for i := len(m.middleWares) - 1; i >= 0; i-- {
w := m.middleWares[i]
rtn = w.Middleware(rtn)
}
return rtn
}