|
|
@ -10,6 +10,15 @@ func GatewayHandler(w http.ResponseWriter, req *http.Request) { |
|
|
|
fmt.Fprintf(w, "Gateway") |
|
|
|
fmt.Fprintf(w, "Gateway") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GatewayGetObjectHandler(w http.ResponseWriter, req *http.Request) { |
|
|
|
|
|
|
|
vars := mux.Vars(req) |
|
|
|
|
|
|
|
bucket := vars["bucket"] |
|
|
|
|
|
|
|
object := vars["object"] |
|
|
|
|
|
|
|
fmt.Fprintf(w, "bucket: "+bucket) |
|
|
|
|
|
|
|
fmt.Fprintf(w, "\r") |
|
|
|
|
|
|
|
fmt.Fprintf(w, "object: "+object) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func RegisterGatewayHandlers(router *mux.Router) { |
|
|
|
func RegisterGatewayHandlers(router *mux.Router) { |
|
|
|
router.HandleFunc("/gateway/rpc", GatewayHandler) |
|
|
|
router.HandleFunc("/{bucket}/{object:.*}", GatewayGetObjectHandler).Methods("GET") |
|
|
|
} |
|
|
|
} |
|
|
|