1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 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"
- )
- func (c *Client) GetHostCap() ([]byte, error) {
- return c.CommonGet("/ISAPI/Event/notification/httpHosts/capabilities")
- }
- 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
- }
- func (c *Client) DelHost() ([]byte, error) {
- return c.CommonDel(nil, "/ISAPI/Event/notification/httpHosts/1")
- }
- func (c *Client) GetHost() ([]byte, error) {
- return c.CommonGet("/ISAPI/Event/notification/httpHosts/1")
- }
|