package isapi import ( "encoding/xml" "github.com/sirupsen/logrus" ) type eventType string const ( shelterAlarm eventType = "shelteralarm" //遮盖报警 fieldAlarm eventType = "fielddetection" //区域入侵 lineAlarm eventType = "linedetection" //越界侦测 regionEntrance eventType = "regionEntrance" //进入区域侦测 regionExiting eventType = "regionExiting" //离开区域侦测 ) //todo 边缘端启动时配置一次, 提供主动配置配置接口 // GetHostCap 获取监听主机参数能力 func (c *Client) GetHostCap() ([]byte, error) { return c.CommonGet("/ISAPI/Event/notification/httpHosts/capabilities") } // PutHost 配置单个监听主机参数 func (c *Client) PutHost(data []byte) (info ResponseStatus, err error) { resp, err := c.CommonPut(data, "/ISAPI/Event/notification/httpHosts") if err != nil { logrus.Error("请求出错", err) return } err = xml.Unmarshal(resp, &info) return } // DelHost 删除单个监听主机参数 func (c *Client) DelHost() ([]byte, error) { return c.CommonDel(nil, "/ISAPI/Event/notification/httpHosts/1") } // GetHost 获取单个监听主机参数 func (c *Client) GetHost() ([]byte, error) { return c.CommonGet("/ISAPI/Event/notification/httpHosts/1") }