diff --git a/pkg/github.com/index.html b/pkg/github.com/index.html index fed5022..1457183 100644 --- a/pkg/github.com/index.html +++ b/pkg/github.com/index.html @@ -1021,6 +1021,17 @@ +
func NewClient(httpClient *http.Client, homeserverURL *url.URL, accessToken, userID string) *Client
NewClient creates a new Matrix Client ready for syncing @@ -385,7 +385,7 @@ SetDisplayName sets the user's profile display name -
func (cli *Client) StopSync()
StopSync stops the ongoing sync started by Sync. @@ -396,7 +396,7 @@ StopSync stops the ongoing sync started by Sync. -
func (cli *Client) Sync()
Sync starts syncing with the provided Homeserver. This function will be invoked continually. @@ -419,7 +419,7 @@ UploadLink uploads an HTTP URL and then returns an MXC URI. -
func (cli *Client) UploadToContentRepo(content io.Reader, contentType string, contentLength int64) (string, error)
UploadToContentRepo uploads the given bytes to the content repository and returns an MXC URI. diff --git a/pkg/github.com/matrix-org/go-neb/services/guggy/index.html b/pkg/github.com/matrix-org/go-neb/services/guggy/index.html index 99da79c..85e8c6e 100644 --- a/pkg/github.com/matrix-org/go-neb/services/guggy/index.html +++ b/pkg/github.com/matrix-org/go-neb/services/guggy/index.html @@ -190,7 +190,7 @@ ServiceType of the Guggy service -
type Service struct { types.DefaultService // The Guggy API key to use when making HTTP requests to Guggy. @@ -220,7 +220,7 @@ Example request: -func (*Service) Commands
+func (*Service) Commands
func (s *Service) Commands(client *matrix.Client) []types.CommandCommands supported: diff --git a/pkg/github.com/matrix-org/go-neb/services/index.html b/pkg/github.com/matrix-org/go-neb/services/index.html index 83cd0b1..b653771 100644 --- a/pkg/github.com/matrix-org/go-neb/services/index.html +++ b/pkg/github.com/matrix-org/go-neb/services/index.html @@ -184,6 +184,17 @@
const DefaultTemplate = (`%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}
+ Change view : %{compare_url}
+ Build details : %{build_url}`)
+ +DefaultTemplate contains the template that will be used if none is supplied. +This matches the default mentioned at: https://docs.travis-ci.com/user/notifications#Customizing-slack-notifications +
+ + +const ServiceType = "travis-ci"
+ +ServiceType of the Travis-CI service. +
+ + + + + + + + +type Service struct { + types.DefaultService + + // The URL which should be added to .travis.yml - Populated by Go-NEB after Service registration. + WebhookURL string `json:"webhook_url"` + // A map from Matrix room ID to Github-style owner/repo repositories. + Rooms map[string]struct { + // A map of "owner/repo" to configuration information + Repos map[string]struct { + // The template string to use when creating notifications. + // + // This is identical to the format of Slack Notifications for Travis-CI: + // https://docs.travis-ci.com/user/notifications#Customizing-slack-notifications + // + // The following variables are available: + // repository_slug: your GitHub repo identifier (like svenfuchs/minimal) + // repository_name: the slug without the username + // build_number: build number + // build_id: build id + // branch: branch build name + // commit: shortened commit SHA + // author: commit author name + // commit_message: commit message of build + // commit_subject: first line of the commit message + // result: result of build + // message: Travis CI message to the build + // duration: total duration of all builds in the matrix + // elapsed_time: time between build start and finish + // compare_url: commit change view URL + // build_url: URL of the build detail + Template string `json:"template"` + } `json:"repos"` + } `json:"rooms"` + // contains filtered or unexported fields +}+
+Service contains the Config fields for the Travis-CI service. +
++This service will send notifications into a Matrix room when Travis-CI sends +webhook events to it. It requires a public domain which Travis-CI can reach. +Notices will be sent as the service user ID. +
++Example JSON request: +
+{ + rooms: { + "!ewfug483gsfe:localhost": { + repos: { + "matrix-org/go-neb": { + template: "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}\nBuild details : %{build_url}" + } + } + } + } +} ++ + + + + + + + + + + + + + +
func (s *Service) OnReceiveWebhook(w http.ResponseWriter, req *http.Request, cli *matrix.Client)+
+OnReceiveWebhook receives requests from Travis-CI and possibly sends requests to Matrix as a result. +
++If the repository matches a known Github repository, a notification will be formed from the +template for that repository and a notice will be sent to Matrix. +
++Go-NEB cannot register with Travis-CI for webhooks automatically. The user must manually add the +webhook endpoint URL to their .travis.yml file: +
+notifications: + webhooks: http://go-neb-endpoint.com/notifications ++
+See https://docs.travis-ci.com/user/notifications#Webhook-notifications for more information. +
+ + + + + + +func (s *Service) PostRegister(oldService types.Service)+
+PostRegister deletes this service if there are no registered repos. +
+ + + + + + +func (s *Service) Register(oldService types.Service, client *matrix.Client) error+
+Register makes sure the Config information supplied is valid. +
+ + + + + + + + + + + + + + + + + + +