Browse Source

Add example configs for each service

kegan/remove-docs-from-readme
Kegan Dougal 8 years ago
parent
commit
209af79efe
  1. 7
      src/github.com/matrix-org/go-neb/services/giphy/giphy.go
  2. 5
      src/github.com/matrix-org/go-neb/services/github/github.go
  3. 15
      src/github.com/matrix-org/go-neb/services/github/github_webhook.go
  4. 7
      src/github.com/matrix-org/go-neb/services/guggy/guggy.go
  5. 16
      src/github.com/matrix-org/go-neb/services/jira/jira.go
  6. 15
      src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go

7
src/github.com/matrix-org/go-neb/services/giphy/giphy.go

@ -34,7 +34,12 @@ type giphySearch struct {
Data []result
}
// Service contains the Config fields for this service.
// Service contains the Config fields for the Giphy Service.
//
// Example:
// {
// "api_key": "dc6zaTOxFJmzC"
// }
type Service struct {
types.DefaultService
// The Giphy API key to use when making HTTP requests to Giphy.

5
src/github.com/matrix-org/go-neb/services/github/github.go

@ -43,6 +43,11 @@ var ownerRepoRegex = regexp.MustCompile(`^([A-z0-9-_]+)/([A-z0-9-_]+)$`)
// }
//
// This will allow the "owner/repo" to be omitted when creating/expanding issues.
//
// Example:
// {
// "RealmID": "github-realm-id"
// }
type Service struct {
types.DefaultService
// The ID of an existing "github" realm. This realm will be used to obtain

15
src/github.com/matrix-org/go-neb/services/github/github_webhook.go

@ -27,6 +27,21 @@ const WebhookServiceType = "github-webhook"
// This service will send notices into a Matrix room when Github sends webhook events
// to it. It requires a public domain which Github can reach. Notices will be sent
// as the service user ID, not the ClientUserID.
//
// Example:
// {
// ClientUserID: "@alice:localhost",
// RealmID: "github-realm-id",
// Rooms: {
// "!qmElAGdFYCHoCJuaNt:localhost": {
// Repos: {
// "matrix-org/go-neb": {
// Events: ["push", "issues", "pull_request"]
// }
// }
// }
// }
// }
type WebhookService struct {
types.DefaultService
webhookEndpointURL string

7
src/github.com/matrix-org/go-neb/services/guggy/guggy.go

@ -32,7 +32,12 @@ type guggyGifResult struct {
Height float64 `json:"height"`
}
// Service contains the Config fields for this service.
// Service contains the Config fields for the Guggy service.
//
// Example:
// {
// "api_key": "fkweugfyuwegfweyg"
// }
type Service struct {
types.DefaultService
// The Guggy API key to use when making HTTP requests to Guggy.

16
src/github.com/matrix-org/go-neb/services/jira/jira.go

@ -32,6 +32,22 @@ var projectKeyRegex = regexp.MustCompile("^[A-z]+$")
// Service contains the Config fields for the JIRA service.
//
// Before you can set up a JIRA Service, you need to set up a JIRA Realm.
//
// Example:
// {
// Rooms: {
// "!qmElAGdFYCHoCJuaNt:localhost": {
// Realms: {
// "jira-realm-id": {
// Projects: {
// "SYN": { Expand: true },
// "BOTS": { Expand: true, Track: true }
// }
// }
// }
// }
// }
// }
type Service struct {
types.DefaultService
webhookEndpointURL string

15
src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go

@ -36,11 +36,24 @@ var (
const minPollingIntervalSeconds = 60 * 5 // 5 min (News feeds can be genuinely spammy)
// Service contains the Config fields for this service.
//
// Example:
// {
// feeds: {
// "http://rss.cnn.com/rss/edition.rss": {
// poll_interval_mins: 60,
// rooms: ["!cBrPbzWazCtlkMNQSF:localhost"]
// },
// "https://www.wired.com/feed/": {
// rooms: ["!qmElAGdFYCHoCJuaNt:localhost"]
// }
// }
// }
type Service struct {
types.DefaultService
// Feeds is a map of feed URL to configuration options for this feed.
Feeds map[string]struct {
// The time to wait between polls. If this is less than minPollingIntervalSeconds, it is ignored.
// Optional. The time to wait between polls. If this is less than minPollingIntervalSeconds, it is ignored.
PollIntervalMins int `json:"poll_interval_mins"`
// The list of rooms to send feed updates into. This cannot be empty.
Rooms []string `json:"rooms"`

Loading…
Cancel
Save