Separate read and write volume handlers.

This commit is contained in:
Chris Lu
2015-02-25 23:59:07 -08:00
parent 226df38c95
commit a506e7953f
4 changed files with 369 additions and 312 deletions

View File

@@ -51,8 +51,13 @@ func NewVolumeServer(publicMux, adminMux *http.ServeMux, ip string,
adminMux.HandleFunc("/stats/counter", vs.guard.WhiteList(statsCounterHandler))
adminMux.HandleFunc("/stats/memory", vs.guard.WhiteList(statsMemoryHandler))
adminMux.HandleFunc("/stats/disk", vs.guard.WhiteList(vs.statsDiskHandler))
if publicMux != adminMux {
// separated admin and public port
adminMux.HandleFunc("/delete", vs.guard.WhiteList(vs.batchDeleteHandler))
adminMux.HandleFunc("/", vs.privateStoreHandler)
}
publicMux.HandleFunc("/delete", vs.guard.Secure(vs.batchDeleteHandler))
publicMux.HandleFunc("/", vs.storeHandler)
publicMux.HandleFunc("/", vs.publicStoreHandler)
go func() {
connected := true