Use netlink instead of shelling out to weave ps

This commit is contained in:
Adam Harrison committed 2016-02-04 12:51:18 +00:00
1 parent f37eb4b77d
commit 65c48707f6
10 files changed
+183 -64

No files matched your search

+20
View File
@@ -1,6 +1,7 @@
package proxy
import (
"encoding/json"
"fmt"
)
@@ -45,6 +46,25 @@ func (j jsonObject) String(key string) (string, error) {
return result, nil
}
func (j jsonObject) Int(key string) (int, error) {
iface, ok := j[key]
if !ok || iface == nil {
return 0, nil
}
result, ok := iface.(json.Number)
if !ok {
return 0, &UnmarshalWrongTypeError{key, "json.Number", iface}
}
i64, err := result.Int64()
if err != nil {
return 0, err
}
return int(i64), nil
}
func (j jsonObject) StringArray(key string) ([]string, error) {
iface, ok := j[key]
if !ok || iface == nil {