diff --git a/src/github.com/matrix-org/go-neb/services/giphy/giphy.go b/src/github.com/matrix-org/go-neb/services/giphy/giphy.go index 53a4697..ff5ae84 100644 --- a/src/github.com/matrix-org/go-neb/services/giphy/giphy.go +++ b/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. diff --git a/src/github.com/matrix-org/go-neb/services/github/github.go b/src/github.com/matrix-org/go-neb/services/github/github.go index 228b0b6..e0d19f5 100644 --- a/src/github.com/matrix-org/go-neb/services/github/github.go +++ b/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 diff --git a/src/github.com/matrix-org/go-neb/services/github/github_webhook.go b/src/github.com/matrix-org/go-neb/services/github/github_webhook.go index 6c126d7..9e4135d 100644 --- a/src/github.com/matrix-org/go-neb/services/github/github_webhook.go +++ b/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 diff --git a/src/github.com/matrix-org/go-neb/services/guggy/guggy.go b/src/github.com/matrix-org/go-neb/services/guggy/guggy.go index d4b50dd..e1a3fda 100644 --- a/src/github.com/matrix-org/go-neb/services/guggy/guggy.go +++ b/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. diff --git a/src/github.com/matrix-org/go-neb/services/jira/jira.go b/src/github.com/matrix-org/go-neb/services/jira/jira.go index 713ccd4..6959ad5 100644 --- a/src/github.com/matrix-org/go-neb/services/jira/jira.go +++ b/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 diff --git a/src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go b/src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go index f3833ab..0dc7e38 100644 --- a/src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go +++ b/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"`