Documentation
¶
Index ¶
- func Close(ctx context.Context, c dahuarpc.Conn, object int64) (bool, error)
- func Create(ctx context.Context, c dahuarpc.Conn) (int64, error)
- func Destroy(ctx context.Context, c dahuarpc.Conn, object int64) (bool, error)
- func FindFile(ctx context.Context, c dahuarpc.Conn, object int64, condition Condition) (bool, error)
- func GetCount(ctx context.Context, c dahuarpc.Conn, object int64) (int, error)
- type Condition
- type ConditionOrder
- type FindNextFileInfo
- type FindNextFileResult
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Condition ¶
type Condition struct { Channel int `json:"Channel"` Dirs []string `json:"Dirs"` Types []string `json:"Types"` Order ConditionOrder `json:"Order"` Redundant string `json:"Redundant"` Events []string `json:"Events"` StartTime dahuarpc.Timestamp `json:"StartTime"` EndTime dahuarpc.Timestamp `json:"EndTime"` Flags []string `json:"Flags"` }
func NewCondtion ¶
type ConditionOrder ¶
type ConditionOrder = string
const ( ConditionOrderAscent ConditionOrder = "Ascent" ConditionOrderDescent ConditionOrder = "Descent" )
type FindNextFileInfo ¶
type FindNextFileInfo struct { Channel int `json:"Channel"` StartTime dahuarpc.Timestamp `json:"StartTime"` EndTime dahuarpc.Timestamp `json:"EndTime"` Length int `json:"Length"` Type string `json:"Type"` FilePath string `json:"FilePath"` Duration int `json:"Duration"` Disk int `json:"Disk"` VideoStream string `json:"VideoStream"` Flags []string `json:"Flags"` Events []string `json:"Events"` Cluster int `json:"Cluster"` Partition int `json:"Partition"` PicIndex int `json:"PicIndex"` Repeat int `json:"Repeat"` // WorkDir is the working directory (e.g. /mnt/dvr/mmc0p2_0). WorkDir string `json:"WorkDir"` // WorkDirSN is indicates that the WorkDir's name is the Serial Number (e.g ftp://192.168.20.30/test/share/XXXXXXXXXXXXXXX). WorkDirSN int `json:"WorkDirSN"` }
func (FindNextFileInfo) Local ¶
func (f FindNextFileInfo) Local() bool
Local checks if the file is stored directly on disk which allows it to be loaded through RPC_Loadfile.
func (FindNextFileInfo) UniqueTime ¶
func (f FindNextFileInfo) UniqueTime(seed int, deviceLocation *time.Location) (time.Time, time.Time, error)
UniqueTime returns start and end times that do not conflict with other files.
Dahua devices can only handle timestamps that are precise up to the second (e.g. "2006-01-02 15:04:05"), the leftover microseconds (.000_000) are used create a unique time. A seed can optionally be passed to not conflict with other devices.
type FindNextFileResult ¶
type FindNextFileResult struct { Found int `json:"found"` Infos []FindNextFileInfo `json:"infos"` }
func FindNextFile ¶
Click to show internal directories.
Click to hide internal directories.