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
@@ -122,9 +122,12 @@ import (
)
func main() {
// Create client
// Create client - endpoint can be:
// - Full URL: "http://192.168.1.100/onvif/device_service"
// - IP with port: "192.168.1.100:8080"
// - IP only: "192.168.1.100" (automatically adds http:// and path)
client, err := onvif.NewClient(
"http://192.168.1.100/onvif/device_service",
"192.168.1.100", // Simple IP address
onvif.WithCredentials("admin", "password"),
onvif.WithTimeout(30*time.Second),
)
@@ -379,7 +382,7 @@ go run main.go
## Architecture
```
go-onvif/
onvif-go/
├── client.go # Main ONVIF client
├── types.go # ONVIF data types
├── errors.go # Error definitions