mirror of
https://github.com/minio/minio.git
synced 2025-03-03 15:20:08 -05:00
Add initial framework for quota
This commit is contained in:
parent
b3f51d53c4
commit
fda50d52c8
@ -145,3 +145,16 @@ func ignoreUnImplementedObjectResources(req *http.Request) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type quotaHandler struct {
|
||||||
|
handler http.Handler
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h quotaHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
|
h.handler.ServeHTTP(w, req)
|
||||||
|
}
|
||||||
|
|
||||||
|
// QuotaHandler implements quotas
|
||||||
|
func QuotaHandler(h http.Handler) http.Handler {
|
||||||
|
return quotaHandler{handler: h}
|
||||||
|
}
|
||||||
|
@ -89,5 +89,7 @@ func HTTPHandler(domain string, driver drivers.Driver) http.Handler {
|
|||||||
log.Fatal(iodine.New(err, map[string]string{"domain": domain}))
|
log.Fatal(iodine.New(err, map[string]string{"domain": domain}))
|
||||||
}
|
}
|
||||||
|
|
||||||
return validateHandler(conf, ignoreResourcesHandler(mux))
|
h := validateHandler(conf, ignoreResourcesHandler(mux))
|
||||||
|
// quota handler is always last
|
||||||
|
return QuotaHandler(h)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user