mirror of
https://github.com/cedricve/go-onvif.git
synced 2025-10-06 17:16:56 +08:00
22 lines
387 B
Go
22 lines
387 B
Go
package onvif
|
|
|
|
import (
|
|
"encoding/json"
|
|
"strings"
|
|
)
|
|
|
|
func interfaceToString(src interface{}) string {
|
|
str, _ := src.(string)
|
|
return str
|
|
}
|
|
|
|
func interfaceToBool(src interface{}) bool {
|
|
strBool := interfaceToString(src)
|
|
return strings.ToLower(strBool) == "true"
|
|
}
|
|
|
|
func prettyJSON(src interface{}) string {
|
|
result, _ := json.MarshalIndent(&src, "", " ")
|
|
return string(result)
|
|
}
|