Documentation ¶
Index ¶
- Constants
- func NewDefewayClient(config DefewayClientConfig) *client
- type DefewayClientConfig
- type DefewayDeviceInfo
- type DefewayEnvLoad
- type DefewayHDD
- type DefewayJuan
- type DefewayNetwork
- type DefewayRecSearch
- type DeviceInfoClient
- type HDDMeta
- type HTTPClientConfig
- type RecordingMeta
- type RecordingsClient
- type RecordingsFetchParams
- type SnapshotClient
Constants ¶
View Source
const ( FLVScriptPath = "cgi-bin/flv.cgi" GWScriptPath = "cgi-bin/gw.cgi" SnapshotScriptPath = "cgi-bin/snapshot.cgi" )
Variables ¶
This section is empty.
Functions ¶
func NewDefewayClient ¶
func NewDefewayClient(config DefewayClientConfig) *client
Types ¶
type DefewayClientConfig ¶
type DefewayClientConfig struct { HTTPClientConfig Address string Username string Password string }
type DefewayDeviceInfo ¶
type DefewayDeviceInfo struct { Name string `xml:"name,attr"` Model string `xml:"model,attr"` SerialNumber string `xml:"serialnumber,attr"` HWVer string `xml:"hwver,attr"` SWVer string `xml:"swver,attr"` RelDateTime string `xml:"reldatetime,attr"` IP string `xml:"ip,attr"` HTTPPort uint16 `xml:"httpport,attr"` ClientPort uint16 `xml:"clientport,attr"` RemoteIP string `xml:"rip,attr"` RemoteHTTPPort uint16 `xml:"rhttpport,attr"` RemoteClientPort uint16 `xml:"rclinetport,attr"` CamCount uint8 `xml:"camcnt,attr"` }
type DefewayEnvLoad ¶
type DefewayEnvLoad struct { Username string `xml:"usr,attr"` Password string `xml:"pwd,attr"` Type uint8 `xml:"type,attr"` ErrorNo uint8 `xml:"errno,attr"` Network *DefewayNetwork `xml:"network,omitempty"` }
func (*DefewayEnvLoad) HasError ¶
func (o *DefewayEnvLoad) HasError() (bool, string)
type DefewayHDD ¶
type DefewayJuan ¶
type DefewayJuan struct { XMLName xml.Name `xml:"juan"` Version string `xml:"ver,attr"` SQU string `xml:"squ,attr"` Direction uint `xml:"dir,attr"` Enc uint `xml:"enc,attr"` ErrorNo uint `xml:"errno,attr"` RecSearch *DefewayRecSearch `xml:"recsearch,omitempty"` DeviceInfo *DefewayDeviceInfo `xml:"devinfo,omitempty"` EnvLoad *DefewayEnvLoad `xml:"envload,omitempty"` HDD *DefewayHDD `xml:"hdd,omitempty"` }
func NewForDeviceInfo ¶
func NewForDeviceInfo(envLoad DefewayEnvLoad, devInfo DefewayDeviceInfo, hdd DefewayHDD) *DefewayJuan
func NewForRecSearch ¶
func NewForRecSearch(recSearch DefewayRecSearch) *DefewayJuan
func UnmarshalJuan ¶
func UnmarshalJuan(data []byte) (*DefewayJuan, error)
func (*DefewayJuan) HasError ¶
func (dj *DefewayJuan) HasError() (bool, string)
func (*DefewayJuan) Marshal ¶
func (dj *DefewayJuan) Marshal() (string, error)
type DefewayNetwork ¶
type DefewayNetwork struct { DHCP uint8 `xml:"dhcp,attr"` MAC string `xml:"mac,attr"` IP string `xml:"ip,attr"` Submask string `xml:"submask,attr"` Gateway string `xml:"gateway,attr"` DNS string `xml:"dns,attr"` HTTPPort uint16 `xml:"httpport,attr"` ClientPort uint16 `xml:"clientport,attr"` ENETID string `xml:"enetid,attr"` DDNS uint8 `xml:"ddns,attr"` DDNSProvider uint8 `xml:"ddnsprovide,attr"` DDNSURL string `xml:"ddnsurl,attr"` DDNSUser string `xml:"ddnsusr,attr"` DDNSPassword string `xml:"ddnspwd,attr"` }
type DefewayRecSearch ¶
type DefewayRecSearch struct { Username string `xml:"usr,attr"` Password string `xml:"pwd,attr"` Channels uint16 `xml:"channels,attr"` Types uint16 `xml:"types,attr"` Date string `xml:"date,attr"` BeginTime string `xml:"begin,attr"` EndTime string `xml:"end,attr"` SessionIdx uint `xml:"session_index,attr"` SessionCount uint `xml:"session_count,attr"` SessionTotal uint `xml:"session_total,attr"` SearchResults []RecordingMeta `xml:"s,omitempty"` }
type DeviceInfoClient ¶
type DeviceInfoClient struct {
// contains filtered or unexported fields
}
func NewDeviceInfoClient ¶
func NewDeviceInfoClient(config DefewayClientConfig) *DeviceInfoClient
func (*DeviceInfoClient) Fetch ¶
func (sc *DeviceInfoClient) Fetch() (*DefewayJuan, error)
type HDDMeta ¶
type HDDMeta struct { Model string Capacity uint64 Used uint64 Status uint8 // 3 - DB error, 4 - Formatted, 5 - OK, else Unformatted }
func (*HDDMeta) UnmarshalXML ¶
type HTTPClientConfig ¶
type RecordingMeta ¶
type RecordingMeta struct { RecordingID uint ChannelID uint16 TypeID uint16 StartTimestamp uint64 EndTimestamp uint64 }
func (*RecordingMeta) GetFileName ¶
func (s *RecordingMeta) GetFileName() string
func (*RecordingMeta) GetFileShortName ¶
func (s *RecordingMeta) GetFileShortName() string
func (*RecordingMeta) UnmarshalXML ¶
func (s *RecordingMeta) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type RecordingsClient ¶
type RecordingsClient struct {
// contains filtered or unexported fields
}
func NewRecordingsClient ¶
func NewRecordingsClient( fetchConfig DefewayClientConfig, downloadConfig DefewayClientConfig, ) *RecordingsClient
func (*RecordingsClient) Download ¶
func (rm *RecordingsClient) Download(recMeta RecordingMeta, dst io.Writer, isPreview bool) error
func (*RecordingsClient) Fetch ¶
func (rm *RecordingsClient) Fetch( fetchParams RecordingsFetchParams, ) ([]RecordingMeta, error)
type RecordingsFetchParams ¶
type SnapshotClient ¶
type SnapshotClient struct {
// contains filtered or unexported fields
}
func NewSnapshotClient ¶
func NewSnapshotClient(config DefewayClientConfig) *SnapshotClient
Click to show internal directories.
Click to hide internal directories.