Skip to content

Commit

Permalink
Update README with usage examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
osery committed Sep 26, 2022
1 parent d03583b commit a11c8f7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@ A generated Onvif client in Go. Contains a simple command line utility to send O
commands/queries to an Onvif compatible device. This also serves as an example of how to use the
generated client programatically.

## CLI Usage

Get the built `gonvif` binary for your system and architecture from our
[Release](https://github.com/eyetowers/gonvif/releases) page.

Then run a command of your choice from one of the supported Onvif ports, e.g., listing all device
profiles using the `media` port, providing the Onvif device URL and credentials:

```bash
gonvif -a http://IP[:PORT] -u USERNAME -p PASSWORD media get-profiles
```

### Shell completion

Get the shell completion script by running the following, using one of `bash`, `zsh`, `fish`,
`powershell`:

```bash
gonvif completion bash
```

## Client Usage

```golang
import "github.com/hooklift/gowsdl/soap"

...

client := soap.NewClient("http://IP[:PORT]/onvif/Media2")
client.SetHeaders(soap.NewSecurity("USERNAME", "PASSWORD"))
media := wsdl.NewMedia2(client)
resp, err := media.GetProfiles(&wsdl.GetProfiles{
Type: []string{"All"},
})
```

## License

Gonvif is open source, released under the [MIT license](./LICENSE).

0 comments on commit a11c8f7

Please sign in to comment.