feat: simplify endpoint API and enhance documentation

This commit is contained in:
ProtoTess
2025-11-12 18:50:26 +00:00
parent 41e8093594
commit 64ce3192a4
6 changed files with 298 additions and 12 deletions
+6 -3
View File
@@ -42,7 +42,7 @@ func main() {
## Step 2: Connect to Camera
Create a client and get basic information:
Create a client and get basic information. The endpoint can be specified in multiple formats:
```go
package main
@@ -56,9 +56,12 @@ import (
)
func main() {
// Create client
// Create client - endpoint accepts multiple formats:
// - Simple IP: "192.168.1.100"
// - IP with port: "192.168.1.100:8080"
// - Full URL: "http://192.168.1.100/onvif/device_service"
client, err := onvif.NewClient(
"http://192.168.1.100/onvif/device_service",
"192.168.1.100", // Simple IP address works!
onvif.WithCredentials("admin", "password"),
onvif.WithTimeout(30*time.Second),
)