Important: This package is still under heavy development, only a partial implementation of the API is available.
Hikvision Go SDK for Intelligence Security API (ISAPI).
This implementation is heavily dependent on the ISAPI Core Protocol. The latest available copy of this specification document was updated on Sep 2019.
To install the SDK, use go get
to fetch the latest version:
go get -u github.com/loozhengyuan/hikvision-sdk/hikvision
Once installed, you may import it directly into your Go application:
import "github.com/loozhengyuan/hikvision-sdk/hikvision"
package main
import (
"fmt"
"github.com/loozhengyuan/hikvision-sdk/hikvision"
)
func main() {
// Create client object
c, err := hikvision.NewClient(
"YOUR_SERVER_HOST",
"YOUR_SERVER_USERNAME",
"YOUR_SERVER_PASSWORD",
)
if err != nil {
fmt.Printf("error: %v\n", err)
}
// Send request
d, err := c.GetDeviceInfo()
if err != nil {
fmt.Printf("error: %v\n", err)
}
fmt.Printf("%+v\n", d)
// Print device information
fmt.Printf("Model: %s\n", d.Model)
fmt.Printf("Serial Number: %s\n", d.SerialNumber)
}
There's still lots of work to be done! Only a small subset of the APIs are implemented, so pull requests are welcome.