From 7822de1f32c6da5d1f19bc699780243e582f4668 Mon Sep 17 00:00:00 2001 From: Ondrej Sery Date: Tue, 27 Sep 2022 14:03:48 +0200 Subject: [PATCH] Rename client package to gonvif. --- README.md | 6 +++--- cmd/gonvif/device/cmd.go | 4 ++-- cmd/gonvif/imaging/cmd.go | 4 ++-- cmd/gonvif/media/cmd.go | 4 ++-- cmd/gonvif/ptz/cmd.go | 4 ++-- pkg/{client => gonvif}/client.go | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) rename pkg/{client => gonvif}/client.go (99%) diff --git a/README.md b/README.md index e523f89..c6d7106 100644 --- a/README.md +++ b/README.md @@ -31,17 +31,17 @@ gonvif completion bash import ( "log" - "github.com/eyetowers/gonvif/pkg/client" + "github.com/eyetowers/gonvif/pkg/gonvif" ) func main() { // Connect to the Onvif device. - onvif, err := client.New("http://IP[:PORT]", "USERNAME", "PASSWORD") + client, err := gonvif.New("http://IP[:PORT]", "USERNAME", "PASSWORD") if err != nil { log.Fatal(err) } // Get the Media2 service client. - media, err := onvif.Media2() + media, err := client.Media2() if err != nil { log.Fatal(err) } diff --git a/cmd/gonvif/device/cmd.go b/cmd/gonvif/device/cmd.go index d4f1d2a..ca015d0 100644 --- a/cmd/gonvif/device/cmd.go +++ b/cmd/gonvif/device/cmd.go @@ -4,8 +4,8 @@ import ( "github.com/spf13/cobra" "github.com/eyetowers/gonvif/cmd/gonvif/root" - "github.com/eyetowers/gonvif/pkg/client" "github.com/eyetowers/gonvif/pkg/generated/onvif/www_onvif_org/ver10/device/wsdl" + "github.com/eyetowers/gonvif/pkg/gonvif" ) var cmd = &cobra.Command{ @@ -22,7 +22,7 @@ func init() { } func ServiceClient(url, username, password string, verbose bool) (wsdl.Device, error) { - onvif, err := client.New(url, username, password, verbose) + onvif, err := gonvif.New(url, username, password, verbose) if err != nil { return nil, err } diff --git a/cmd/gonvif/imaging/cmd.go b/cmd/gonvif/imaging/cmd.go index 57b5650..906a8bf 100644 --- a/cmd/gonvif/imaging/cmd.go +++ b/cmd/gonvif/imaging/cmd.go @@ -4,8 +4,8 @@ import ( "github.com/spf13/cobra" "github.com/eyetowers/gonvif/cmd/gonvif/root" - "github.com/eyetowers/gonvif/pkg/client" "github.com/eyetowers/gonvif/pkg/generated/onvif/www_onvif_org/ver20/imaging/wsdl" + "github.com/eyetowers/gonvif/pkg/gonvif" ) var cmd = &cobra.Command{ @@ -28,7 +28,7 @@ func init() { } func ServiceClient(url, username, password string, verbose bool) (wsdl.ImagingPort, error) { - onvif, err := client.New(url, username, password, verbose) + onvif, err := gonvif.New(url, username, password, verbose) if err != nil { return nil, err } diff --git a/cmd/gonvif/media/cmd.go b/cmd/gonvif/media/cmd.go index 8b1a4b0..4cd47f1 100644 --- a/cmd/gonvif/media/cmd.go +++ b/cmd/gonvif/media/cmd.go @@ -4,8 +4,8 @@ import ( "github.com/spf13/cobra" "github.com/eyetowers/gonvif/cmd/gonvif/root" - "github.com/eyetowers/gonvif/pkg/client" "github.com/eyetowers/gonvif/pkg/generated/onvif/www_onvif_org/ver20/media/wsdl" + "github.com/eyetowers/gonvif/pkg/gonvif" ) var cmd = &cobra.Command{ @@ -24,7 +24,7 @@ func init() { } func ServiceClient(url, username, password string, verbose bool) (wsdl.Media2, error) { - onvif, err := client.New(url, username, password, verbose) + onvif, err := gonvif.New(url, username, password, verbose) if err != nil { return nil, err } diff --git a/cmd/gonvif/ptz/cmd.go b/cmd/gonvif/ptz/cmd.go index 87cba30..4ec4788 100644 --- a/cmd/gonvif/ptz/cmd.go +++ b/cmd/gonvif/ptz/cmd.go @@ -4,8 +4,8 @@ import ( "github.com/spf13/cobra" "github.com/eyetowers/gonvif/cmd/gonvif/root" - "github.com/eyetowers/gonvif/pkg/client" "github.com/eyetowers/gonvif/pkg/generated/onvif/www_onvif_org/ver20/ptz/wsdl" + "github.com/eyetowers/gonvif/pkg/gonvif" ) var cmd = &cobra.Command{ @@ -23,7 +23,7 @@ func init() { } func ServiceClient(url, username, password string, verbose bool) (wsdl.PTZ, error) { - onvif, err := client.New(url, username, password, verbose) + onvif, err := gonvif.New(url, username, password, verbose) if err != nil { return nil, err } diff --git a/pkg/client/client.go b/pkg/gonvif/client.go similarity index 99% rename from pkg/client/client.go rename to pkg/gonvif/client.go index ee95e1d..08e1b47 100644 --- a/pkg/client/client.go +++ b/pkg/gonvif/client.go @@ -1,4 +1,4 @@ -package client +package gonvif import ( "bytes"