Update comments across the codebase

This commit is contained in:
Harshavardhana
2015-03-03 02:36:12 -08:00
parent 137584d658
commit 3a3c8645fc
24 changed files with 198 additions and 346 deletions

View File

@@ -52,6 +52,7 @@ func validateHandler(conf config.Config, h http.Handler) http.Handler {
return vHandler{conf, h}
}
// Validate handler ServeHTTP() wrapper
func (h vHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
accessKey := stripAccessKey(r)
acceptsContentType := getContentType(r)
@@ -95,6 +96,7 @@ func ignoreResourcesHandler(h http.Handler) http.Handler {
return rHandler{h}
}
// Resource handler ServeHTTP() wrapper
func (h rHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
acceptsContentType := getContentType(r)
if ignoreUnImplementedObjectResources(r) || ignoreUnImplementedBucketResources(r) {
@@ -109,7 +111,7 @@ func (h rHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
//// helpers
// Checks requests for unimplemented resources
// Checks requests for unimplemented Bucket resources
func ignoreUnImplementedBucketResources(req *http.Request) bool {
q := req.URL.Query()
for name := range q {
@@ -120,6 +122,7 @@ func ignoreUnImplementedBucketResources(req *http.Request) bool {
return false
}
// Checks requests for unimplemented Object resources
func ignoreUnImplementedObjectResources(req *http.Request) bool {
q := req.URL.Query()
for name := range q {

View File

@@ -56,8 +56,13 @@ func generateBucketsListResult(buckets []mstorage.BucketMetadata) BucketListResp
type ItemKey []*Item
func (b ItemKey) Len() int { return len(b) }
func (b ItemKey) Swap(i, j int) { b[i], b[j] = b[j], b[i] }
// Len
func (b ItemKey) Len() int { return len(b) }
// Swap
func (b ItemKey) Swap(i, j int) { b[i], b[j] = b[j], b[i] }
// Less
func (b ItemKey) Less(i, j int) bool { return b[i].Key < b[j].Key }
// takes a set of objects and prepares the objects for serialization

View File

@@ -42,6 +42,7 @@ type encoder interface {
Encode(v interface{}) error
}
// Http wrapper handler
func HttpHandler() http.Handler {
mux := mux.NewRouter()
var api = webUiApi{}