Move remote disk StorageAPI abstraction from RPC to REST (#6464)

This commit is contained in:
Krishna Srinivas
2018-10-04 17:44:06 -07:00
committed by kannappanr
parent 670f9788e3
commit 81bee93b8d
12 changed files with 945 additions and 633 deletions

View File

@@ -458,3 +458,13 @@ func CloseResponse(respBody io.ReadCloser) {
respBody.Close()
}
}
// Used for registering with rest handlers (have a look at registerStorageRESTHandlers for usage example)
// If it is passed ["aaaa", "bbbb"], it returns ["aaaa", "{aaaa:.*}", "bbbb", "{bbbb:.*}"]
func restQueries(keys ...string) []string {
var accumulator []string
for _, key := range keys {
accumulator = append(accumulator, key, "{"+key+":.*}")
}
return accumulator
}