Implement some API for media service

This commit is contained in:
Radhi Fadlillah
2017-05-22 22:36:35 +07:00
parent 94d9abee06
commit 7932616ed3
5 changed files with 267 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package onvif
import (
"encoding/json"
"strconv"
"strings"
)
@@ -19,6 +20,12 @@ func interfaceToBool(src interface{}) bool {
return strings.ToLower(strBool) == "true"
}
func interfaceToInt(src interface{}) int {
strNumber := interfaceToString(src)
number, _ := strconv.Atoi(strNumber)
return number
}
func prettyJSON(src interface{}) string {
result, _ := json.MarshalIndent(&src, "", " ")
return string(result)