Updated Notifiers (markdown)

master
Hunter Long 2018-09-11 19:25:28 -07:00
parent c5f3c59980
commit 52edced855
1 changed files with 30 additions and 6 deletions

@ -33,13 +33,37 @@ type BasicEvents interface {
}
```
## Notifier Struct
```go
var example = &Example{&notifier.Notification{
Method: "example", // unique method name
Host: "http://exmaplehost.com", // default 'host' field
Form: []notifier.NotificationForm{{
Type: "text", // text, password, number, or email
Title: "Host", // The title of value in form
Placeholder: "Insert your Host here.", // Optional placeholder in input
DbField: "host", // An accepted DbField value (read below)
}},
}
```
## Notifier Form
Include a form with your notifier so other users can save API keys, username, passwords, and other values.
#### Accepted DbField Values
### Accepted DbField Values
The `notifier.NotificationForm` has a field called `DbField` which is the column to save the value into the database. Below are the acceptable DbField string names to include in your form.
- `host` used for a URL or API endpoint
- `host` used for a URL or API endpoint
- `host` used for a URL or API endpoint
- `host` used for a URL or API endpoint
- `host` used for a URL or API endpoint
- `host` used for a URL or API endpoint
- `username` used for a username
- `password` used for a password
- `port` used for a integer port number
- `api_key` used for some kind of API key
- `api_secret` used for some API secret
- `var1` used for any type of string
- `var2` used for any type of string (extra)
### Form Elements
You can completely custom your notifications to include a detailed form.
- `Type` is a HTML input type for your field
- `Title` give your input element a title
- `Placeholder` optional field if you want a placeholder in input
- `DbField` required field to save variable into database (read above)