mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-11 07:11:02 +00:00
remove handleInspect and inspect validator
This commit is contained in:
parent
882327b0a6
commit
e21382fab8
1 changed files with 0 additions and 32 deletions
|
|
@ -260,7 +260,6 @@ func (h *Handler) populateValidators() {
|
|||
h.validators["GetTransaction"] = queryValidationSpecRequired()
|
||||
h.validators["PostTransaction"] = queryValidationSpecRequired()
|
||||
h.validators["PostFinishTransaction"] = queryValidationSpecRequired()
|
||||
h.validators["Inspect"] = queryValidationSpecRequired().Optional("indexes", "fields", "views", "shards", "checksum", "containers")
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -802,37 +801,6 @@ func (h *Handler) handleGetInfo(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
func (h *Handler) handleInspect(w http.ResponseWriter, r *http.Request) {
|
||||
if !validHeaderAcceptJSON(r.Header) {
|
||||
http.Error(w, "JSON only acceptable response", http.StatusNotAcceptable)
|
||||
return
|
||||
}
|
||||
q := r.URL.Query()
|
||||
_, checksum := q["checksum"]
|
||||
_, containers := q["containers"]
|
||||
req := pilosa.InspectRequest{
|
||||
HolderFilterParams: pilosa.HolderFilterParams{
|
||||
Indexes: q.Get("indexes"),
|
||||
Fields: q.Get("fields"),
|
||||
Views: q.Get("views"),
|
||||
Shards: q.Get("shards"),
|
||||
},
|
||||
InspectRequestParams: pilosa.InspectRequestParams{
|
||||
Checksum: checksum,
|
||||
Containers: containers,
|
||||
},
|
||||
}
|
||||
info, err := h.api.Inspect(r.Context(), &req)
|
||||
if err != nil {
|
||||
http.Error(w, fmt.Sprintf("inspect request: %v", err), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
if err := json.NewEncoder(w).Encode(info); err != nil {
|
||||
h.logger.Errorf("write inspect response error: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
type getSchemaResponse struct {
|
||||
Indexes []*pilosa.IndexInfo `json:"indexes"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue