Skip to content

Commit

Permalink
Updating readme examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlettc22 committed Jul 3, 2019
1 parent 949bf60 commit 4ede560
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ go get github.com/PremiereGlobal/go-deadmanssnitch
package main
import (
"github.com/PremiereGlobal/go-deadmansnitch"
"github.com/PremiereGlobal/go-deadmanssnitch"
)
var apiKey = "" // Set your api key here
var apiKey = "" // Set your api key here
func main() {
client := deadmanssnitch.NewClient(apiKey)
...
client := deadmanssnitch.NewClient(apiKey)
...
}
```

Expand All @@ -34,38 +34,36 @@ For more information, read the [godoc package documentation](http://godoc.org/gi

```
var snitchToken = "" // Set your snitch token here
_, err := client.CheckIn(snitchToken)
err := client.CheckIn(snitchToken)
if err != nil {
panic(err)
}
panic(err)
}
```

### List All Snitches

```
snitches, err := client.ListSnitches([]string{})
if err != nil {
panic(err)
}
snitches, err := client.ListSnitches([]string{})
if err != nil {
panic(err)
}
```

### Create Snitch

```
snitch := deadmanssnitch.Snitch {
Name: "testSnitch",
Interval: "hourly",
AlertType: "basic",
Tags: []string{"test"},
Notes: "This is an example snitch",
}
snitches, err := client.CreateSnitch(snitch)
if err != nil {
panic(err)
}
snitch := deadmanssnitch.Snitch {
Name: "testSnitch",
Interval: "hourly",
AlertType: "basic",
Tags: []string{"test"},
Notes: "This is an example snitch",
}
createdSnitch, err := client.CreateSnitch(&snitch)
if err != nil {
panic(createdSnitch)
}
```

## Testing the Client Library
Expand Down

0 comments on commit 4ede560

Please sign in to comment.