summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/utils/handler.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-01-21 12:44:50 -0600
committerBrent Baude <bbaude@redhat.com>2020-01-23 11:58:26 -0600
commitcf7be58b2c160e2e1df737015c913fc1aff1dbe8 (patch)
tree46b7b75d80fc22fc69e6f3ddb1f4dec1c931ef35 /pkg/api/handlers/utils/handler.go
parente6cf0ec857fdda82479f630defd0c9f738e9aab4 (diff)
downloadpodman-cf7be58b2c160e2e1df737015c913fc1aff1dbe8.tar.gz
podman-cf7be58b2c160e2e1df737015c913fc1aff1dbe8.tar.bz2
podman-cf7be58b2c160e2e1df737015c913fc1aff1dbe8.zip
Review corrections pass #2
Add API review comments to correct documentation and endpoints. Also, add a libpode prune method to reduce code duplication. Only used right now for the API but when the remote client is wired, we will switch over there too. Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/api/handlers/utils/handler.go')
-rw-r--r--pkg/api/handlers/utils/handler.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/api/handlers/utils/handler.go b/pkg/api/handlers/utils/handler.go
index 2fd9bffba..f2ce26f1a 100644
--- a/pkg/api/handlers/utils/handler.go
+++ b/pkg/api/handlers/utils/handler.go
@@ -51,3 +51,11 @@ func WriteJSON(w http.ResponseWriter, code int, value interface{}) {
logrus.Errorf("unable to write json: %q", err)
}
}
+
+func FilterMapToString(filters map[string][]string) (string, error) {
+ f, err := json.Marshal(filters)
+ if err != nil {
+ return "", err
+ }
+ return string(f), nil
+}