Browse Source

Update GH pages

gh-pages
Kegan Dougal 8 years ago
parent
commit
8ebff5e31c
  1. 23
      pkg/github.com/index.html
  2. 10
      pkg/github.com/matrix-org/go-neb/clients/index.html
  3. 23
      pkg/github.com/matrix-org/go-neb/index.html
  4. 314
      pkg/github.com/matrix-org/go-neb/plugin/index.html
  5. 65
      pkg/github.com/matrix-org/go-neb/services/echo/index.html
  6. 75
      pkg/github.com/matrix-org/go-neb/services/giphy/index.html
  7. 285
      pkg/github.com/matrix-org/go-neb/services/github/index.html
  8. 74
      pkg/github.com/matrix-org/go-neb/services/guggy/index.html
  9. 12
      pkg/github.com/matrix-org/go-neb/services/index.html
  10. 165
      pkg/github.com/matrix-org/go-neb/services/jira/index.html
  11. 132
      pkg/github.com/matrix-org/go-neb/services/rssbot/index.html
  12. 211
      pkg/github.com/matrix-org/go-neb/types/index.html
  13. 23
      pkg/github.com/matrix-org/index.html

23
pkg/github.com/index.html

@ -845,17 +845,6 @@
<tr>
<td class="pkg-name" style="padding-left: 40px;">
<a href="matrix-org/go-neb/plugin/index.html">plugin</a>
</td>
<td class="pkg-synopsis">
</td>
</tr>
<tr> <tr>
<td class="pkg-name" style="padding-left: 40px;"> <td class="pkg-name" style="padding-left: 40px;">
<a href="matrix-org/go-neb/polling/index.html">polling</a> <a href="matrix-org/go-neb/polling/index.html">polling</a>
@ -938,7 +927,7 @@
<a href="matrix-org/go-neb/services/echo/index.html">echo</a> <a href="matrix-org/go-neb/services/echo/index.html">echo</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package echo implements a Service which echoes back !commands.
</td> </td>
</tr> </tr>
@ -949,7 +938,7 @@
<a href="matrix-org/go-neb/services/giphy/index.html">giphy</a> <a href="matrix-org/go-neb/services/giphy/index.html">giphy</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package giphy implements a Service which adds !commands for Giphy.
</td> </td>
</tr> </tr>
@ -960,7 +949,7 @@
<a href="matrix-org/go-neb/services/github/index.html">github</a> <a href="matrix-org/go-neb/services/github/index.html">github</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package github implements a command service and a webhook service for interacting with Github.
</td> </td>
</tr> </tr>
@ -993,7 +982,7 @@
<a href="matrix-org/go-neb/services/guggy/index.html">guggy</a> <a href="matrix-org/go-neb/services/guggy/index.html">guggy</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package guggy implements a Service which adds !commands for Guggy.
</td> </td>
</tr> </tr>
@ -1004,7 +993,7 @@
<a href="matrix-org/go-neb/services/jira/index.html">jira</a> <a href="matrix-org/go-neb/services/jira/index.html">jira</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package jira implements a command and webhook service for interacting with JIRA.
</td> </td>
</tr> </tr>
@ -1026,7 +1015,7 @@
<a href="matrix-org/go-neb/services/rssbot/index.html">rssbot</a> <a href="matrix-org/go-neb/services/rssbot/index.html">rssbot</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package rssbot implements a Service capable of reading Atom/RSS feeds.
</td> </td>
</tr> </tr>

10
pkg/github.com/matrix-org/go-neb/clients/index.html

@ -185,7 +185,7 @@
<h2 id="Clients">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/clients/clients.go?s=963:1124#L32">Clients</a></h2>
<h2 id="Clients">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/clients/clients.go?s=1010:1171#L34">Clients</a></h2>
<pre>type Clients struct { <pre>type Clients struct {
<span class="comment">// contains filtered or unexported fields</span> <span class="comment">// contains filtered or unexported fields</span>
}</pre> }</pre>
@ -204,7 +204,7 @@ A Clients is a collection of clients used for bot services.
<h3 id="New">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/clients/clients.go?s=1174:1233#L41">New</a></h3>
<h3 id="New">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/clients/clients.go?s=1221:1280#L43">New</a></h3>
<pre>func New(db *<a href="../database/index.html">database</a>.<a href="../database/index.html#ServiceDB">ServiceDB</a>, cli *<a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#Client">Client</a>) *<a href="index.html#Clients">Clients</a></pre> <pre>func New(db *<a href="../database/index.html">database</a>.<a href="../database/index.html#ServiceDB">ServiceDB</a>, cli *<a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#Client">Client</a>) *<a href="index.html#Clients">Clients</a></pre>
<p> <p>
New makes a new collection of matrix clients New makes a new collection of matrix clients
@ -216,7 +216,7 @@ New makes a new collection of matrix clients
<h3 id="Clients.Client">func (*Clients) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/clients/clients.go?s=1426:1489#L51">Client</a></h3>
<h3 id="Clients.Client">func (*Clients) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/clients/clients.go?s=1473:1536#L53">Client</a></h3>
<pre>func (c *<a href="index.html#Clients">Clients</a>) Client(userID <a href="../../../../builtin/index.html#string">string</a>) (*<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre> <pre>func (c *<a href="index.html#Clients">Clients</a>) Client(userID <a href="../../../../builtin/index.html#string">string</a>) (*<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre>
<p> <p>
Client gets a client for the userID Client gets a client for the userID
@ -227,7 +227,7 @@ Client gets a client for the userID
<h3 id="Clients.Start">func (*Clients) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/clients/clients.go?s=1889:1920#L67">Start</a></h3>
<h3 id="Clients.Start">func (*Clients) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/clients/clients.go?s=1936:1967#L69">Start</a></h3>
<pre>func (c *<a href="index.html#Clients">Clients</a>) Start() <a href="../../../../builtin/index.html#error">error</a></pre> <pre>func (c *<a href="index.html#Clients">Clients</a>) Start() <a href="../../../../builtin/index.html#error">error</a></pre>
<p> <p>
Start listening on client /sync streams Start listening on client /sync streams
@ -238,7 +238,7 @@ Start listening on client /sync streams
<h3 id="Clients.Update">func (*Clients) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/clients/clients.go?s=1698:1773#L61">Update</a></h3>
<h3 id="Clients.Update">func (*Clients) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/clients/clients.go?s=1745:1820#L63">Update</a></h3>
<pre>func (c *<a href="index.html#Clients">Clients</a>) Update(config <a href="../api/index.html">api</a>.<a href="../api/index.html#ClientConfig">ClientConfig</a>) (<a href="../api/index.html">api</a>.<a href="../api/index.html#ClientConfig">ClientConfig</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre> <pre>func (c *<a href="index.html#Clients">Clients</a>) Update(config <a href="../api/index.html">api</a>.<a href="../api/index.html#ClientConfig">ClientConfig</a>) (<a href="../api/index.html">api</a>.<a href="../api/index.html#ClientConfig">ClientConfig</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre>
<p> <p>
Update updates the config for a matrix client Update updates the config for a matrix client

23
pkg/github.com/matrix-org/go-neb/index.html

@ -177,17 +177,6 @@
<tr>
<td class="pkg-name" style="padding-left: 0px;">
<a href="plugin/index.html">plugin</a>
</td>
<td class="pkg-synopsis">
</td>
</tr>
<tr> <tr>
<td class="pkg-name" style="padding-left: 0px;"> <td class="pkg-name" style="padding-left: 0px;">
<a href="polling/index.html">polling</a> <a href="polling/index.html">polling</a>
@ -270,7 +259,7 @@
<a href="services/echo/index.html">echo</a> <a href="services/echo/index.html">echo</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package echo implements a Service which echoes back !commands.
</td> </td>
</tr> </tr>
@ -281,7 +270,7 @@
<a href="services/giphy/index.html">giphy</a> <a href="services/giphy/index.html">giphy</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package giphy implements a Service which adds !commands for Giphy.
</td> </td>
</tr> </tr>
@ -292,7 +281,7 @@
<a href="services/github/index.html">github</a> <a href="services/github/index.html">github</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package github implements a command service and a webhook service for interacting with Github.
</td> </td>
</tr> </tr>
@ -325,7 +314,7 @@
<a href="services/guggy/index.html">guggy</a> <a href="services/guggy/index.html">guggy</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package guggy implements a Service which adds !commands for Guggy.
</td> </td>
</tr> </tr>
@ -336,7 +325,7 @@
<a href="services/jira/index.html">jira</a> <a href="services/jira/index.html">jira</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package jira implements a command and webhook service for interacting with JIRA.
</td> </td>
</tr> </tr>
@ -358,7 +347,7 @@
<a href="services/rssbot/index.html">rssbot</a> <a href="services/rssbot/index.html">rssbot</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package rssbot implements a Service capable of reading Atom/RSS feeds.
</td> </td>
</tr> </tr>

314
pkg/github.com/matrix-org/go-neb/plugin/index.html

@ -1,314 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#375EAB">
<title>plugin - The Go Programming Language</title>
<link type="text/css" rel="stylesheet" href="../../../../../lib/godoc/style.css">
<link rel="stylesheet" href="../../../../../lib/godoc/jquery.treeview.css">
<script type="text/javascript">window.initFuncs = [];</script>
</head>
<body>
<div id='lowframe' style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
...
</div><!-- #lowframe -->
<div id="topbar" class="wide"><div class="container">
<div class="top-heading" id="heading-wide"><a href="http://localhost:6060/">The Go Programming Language</a></div>
<div class="top-heading" id="heading-narrow"><a href="http://localhost:6060/">Go</a></div>
<a href="index.html#" id="menu-button"><span id="menu-button-arrow">&#9661;</span></a>
<form method="GET" action="http://localhost:6060/search">
<div id="menu">
<a href="http://localhost:6060/doc/">Documents</a>
<a href="http://localhost:6060/pkg/">Packages</a>
<a href="http://localhost:6060/project/">The Project</a>
<a href="http://localhost:6060/help/">Help</a>
<a href="http://localhost:6060/blog/">Blog</a>
<input type="text" id="search" name="q" class="inactive" value="Search" placeholder="Search">
</div>
</form>
</div></div>
<div id="page" class="wide">
<div class="container">
<h1>Package plugin</h1>
<div id="nav"></div>
<!--
Copyright 2009 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<!--
Note: Static (i.e., not template-generated) href and id
attributes start with "pkg-" to make it impossible for
them to conflict with generated attributes (some of which
correspond to Go identifiers).
-->
<script type='text/javascript'>
document.ANALYSIS_DATA = null;
document.CALLGRAPH = null;
</script>
<div id="short-nav">
<dl>
<dd><code>import "github.com/matrix-org/go-neb/plugin"</code></dd>
</dl>
<dl>
<dd><a href="index.html#pkg-overview" class="overviewLink">Overview</a></dd>
<dd><a href="index.html#pkg-index" class="indexLink">Index</a></dd>
</dl>
</div>
<!-- The package's Name is printed as title by the top-level template -->
<div id="pkg-overview" class="toggleVisible">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
</div>
</div>
<div id="pkg-index" class="toggleVisible">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
<div id="manual-nav">
<dl>
<dd><a href="index.html#OnMessage">func OnMessage(plugins []Plugin, client *matrix.Client, event *matrix.Event)</a></dd>
<dd><a href="index.html#Command">type Command</a></dd>
<dd><a href="index.html#Expansion">type Expansion</a></dd>
<dd><a href="index.html#Plugin">type Plugin</a></dd>
</dl>
</div><!-- #manual-nav -->
<h4>Package files</h4>
<p>
<span style="font-size:90%">
<a href="http://localhost:6060/src/github.com/matrix-org/go-neb/plugin/plugin.go">plugin.go</a>
</span>
</p>
</div><!-- .expanded -->
</div><!-- #pkg-index -->
<div id="pkg-callgraph" class="toggle" style="display: none">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Internal Call Graph section">Internal call graph ▹</h2>
</div> <!-- .expanded -->
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Internal Call Graph section">Internal call graph ▾</h2>
<p>
In the call graph viewer below, each node
is a function belonging to this package
and its children are the functions it
calls&mdash;perhaps dynamically.
</p>
<p>
The root nodes are the entry points of the
package: functions that may be called from
outside the package.
There may be non-exported or anonymous
functions among them if they are called
dynamically from another package.
</p>
<p>
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring <code>func</code>
token.
</p>
<p>
Functions may be omitted if they were
determined to be unreachable in the
particular programs or tests that were
analyzed.
</p>
<!-- Zero means show all package entry points. -->
<ul style="margin-left: 0.5in" id="callgraph-0" class="treeview"></ul>
</div>
</div> <!-- #pkg-callgraph -->
<h2 id="OnMessage">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/plugin/plugin.go?s=5228:5304#L155">OnMessage</a></h2>
<pre>func OnMessage(plugins []<a href="index.html#Plugin">Plugin</a>, client *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>, event *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Event">Event</a>)</pre>
<p>
OnMessage checks the message event to see whether it contains any commands
or expansions from the listed plugins and processes those commands or
expansions.
</p>
<h2 id="Command">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/plugin/plugin.go?s=644:817#L12">Command</a></h2>
<pre>type Command struct {
Path []<a href="../../../../builtin/index.html#string">string</a>
Arguments []<a href="../../../../builtin/index.html#string">string</a>
Help <a href="../../../../builtin/index.html#string">string</a>
Command func(roomID, userID <a href="../../../../builtin/index.html#string">string</a>, arguments []<a href="../../../../builtin/index.html#string">string</a>) (content interface{}, err <a href="../../../../builtin/index.html#error">error</a>)
}</pre>
<p>
A Command is something that a user invokes by sending a message starting with &#39;!&#39;
followed by a list of strings that name the command, followed by a list of argument
strings. The argument strings may be quoted using &#39;\&#34;&#39; and &#39;\&rdquo; in the same way
that they are quoted in the unix shell.
</p>
<h2 id="Expansion">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/plugin/plugin.go?s=1073:1194#L23">Expansion</a></h2>
<pre>type Expansion struct {
Regexp *<a href="../../../../regexp/index.html">regexp</a>.<a href="../../../../regexp/index.html#Regexp">Regexp</a>
Expand func(roomID, userID <a href="../../../../builtin/index.html#string">string</a>, matchingGroups []<a href="../../../../builtin/index.html#string">string</a>) interface{}
}</pre>
<p>
An Expansion is something that actives when the user sends any message
containing a string matching a given pattern. For example an RFC expansion
might expand &#34;RFC 6214&#34; into &#34;Adaptation of RFC 1149 for IPv6&#34; and link to
the appropriate RFC.
</p>
<h2 id="Plugin">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/plugin/plugin.go?s=276:344#L3">Plugin</a></h2>
<pre>type Plugin struct {
Commands []<a href="index.html#Command">Command</a>
Expansions []<a href="index.html#Expansion">Expansion</a>
}</pre>
<p>
A Plugin is a list of commands and expansions to apply to incoming messages.
</p>
<div id="footer">
Build version go1.6.<br>
Except as <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
the content of this page is licensed under the
Creative Commons Attribution 3.0 License,
and code is licensed under a <a href="http://localhost:6060/LICENSE">BSD license</a>.<br>
<a href="http://localhost:6060/doc/tos.html">Terms of Service</a> |
<a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
</div>
</div><!-- .container -->
</div><!-- #page -->
<!-- TODO(adonovan): load these from <head> using "defer" attribute? -->
<script type="text/javascript" src="../../../../../lib/godoc/jquery.js"></script>
<script type="text/javascript" src="../../../../../lib/godoc/jquery.treeview.js"></script>
<script type="text/javascript" src="../../../../../lib/godoc/jquery.treeview.edit.js"></script>
<script type="text/javascript" src="../../../../../lib/godoc/godocs.js"></script>
</body>
</html>

65
pkg/github.com/matrix-org/go-neb/services/echo/index.html

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#375EAB"> <meta name="theme-color" content="#375EAB">
<title>services - The Go Programming Language</title>
<title>echo - The Go Programming Language</title>
<link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css"> <link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css">
@ -42,7 +42,7 @@
<div class="container"> <div class="container">
<h1>Package services</h1>
<h1>Package echo</h1>
@ -87,6 +87,9 @@
</div> </div>
<div class="expanded"> <div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2> <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
<p>
Package echo implements a Service which echoes back !commands.
</p>
</div> </div>
</div> </div>
@ -103,10 +106,20 @@
<div id="manual-nav"> <div id="manual-nav">
<dl> <dl>
<dd><a href="index.html#pkg-constants">Constants</a></dd>
<dd><a href="index.html#Service">type Service</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.Commands">func (e *Service) Commands(cli *matrix.Client, roomID string) []types.Command</a></dd>
</dl> </dl>
</div><!-- #manual-nav --> </div><!-- #manual-nav -->
@ -163,6 +176,54 @@
</div> <!-- #pkg-callgraph --> </div> <!-- #pkg-callgraph -->
<h2 id="pkg-constants">Constants</h2>
<pre>const <span id="ServiceType">ServiceType</span> = &#34;echo&#34;</pre>
<p>
ServiceType of the Echo service
</p>
<h2 id="Service">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/echo/echo.go?s=309:354#L5">Service</a></h2>
<pre>type Service struct {
<a href="../../types/index.html">types</a>.<a href="../../types/index.html#DefaultService">DefaultService</a>
}</pre>
<p>
Service represents the Echo service. It has no Config fields.
</p>
<h3 id="Service.Commands">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/echo/echo.go?s=449:526#L12">Commands</a></h3>
<pre>func (e *<a href="index.html#Service">Service</a>) Commands(cli *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>, roomID <a href="../../../../../builtin/index.html#string">string</a>) []<a href="../../types/index.html">types</a>.<a href="../../types/index.html#Command">Command</a></pre>
<p>
Commands supported:
</p>
<pre>!echo some message
</pre>
<p>
Responds with a notice of &#34;some message&#34;.
</p>

75
pkg/github.com/matrix-org/go-neb/services/giphy/index.html

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#375EAB"> <meta name="theme-color" content="#375EAB">
<title>services - The Go Programming Language</title>
<title>giphy - The Go Programming Language</title>
<link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css"> <link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css">
@ -42,7 +42,7 @@
<div class="container"> <div class="container">
<h1>Package services</h1>
<h1>Package giphy</h1>
@ -87,6 +87,9 @@
</div> </div>
<div class="expanded"> <div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2> <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
<p>
Package giphy implements a Service which adds !commands for Giphy.
</p>
</div> </div>
</div> </div>
@ -103,10 +106,20 @@
<div id="manual-nav"> <div id="manual-nav">
<dl> <dl>
<dd><a href="index.html#pkg-constants">Constants</a></dd>
<dd><a href="index.html#Service">type Service</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.Commands">func (s *Service) Commands(client *matrix.Client, roomID string) []types.Command</a></dd>
</dl> </dl>
</div><!-- #manual-nav --> </div><!-- #manual-nav -->
@ -163,6 +176,64 @@
</div> <!-- #pkg-callgraph --> </div> <!-- #pkg-callgraph -->
<h2 id="pkg-constants">Constants</h2>
<pre>const <span id="ServiceType">ServiceType</span> = &#34;giphy&#34;</pre>
<p>
ServiceType of the Giphy service.
</p>
<h2 id="Service">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/giphy/giphy.go?s=809:999#L33">Service</a></h2>
<pre>type Service struct {
<a href="../../types/index.html">types</a>.<a href="../../types/index.html#DefaultService">DefaultService</a>
<span class="comment">// The Giphy API key to use when making HTTP requests to Giphy.</span>
<span class="comment">// The public beta API key is &#34;dc6zaTOxFJmzC&#34;.</span>
APIKey <a href="../../../../../builtin/index.html#string">string</a> `json:&#34;api_key&#34;`
}</pre>
<p>
Service contains the Config fields for the Giphy Service.
</p>
<p>
Example:
</p>
<pre>{
&#34;api_key&#34;: &#34;dc6zaTOxFJmzC&#34;
}
</pre>
<h3 id="Service.Commands">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/giphy/giphy.go?s=1136:1216#L43">Commands</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) Commands(client *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>, roomID <a href="../../../../../builtin/index.html#string">string</a>) []<a href="../../types/index.html">types</a>.<a href="../../types/index.html#Command">Command</a></pre>
<p>
Commands supported:
</p>
<pre>!giphy some search query without quotes
</pre>
<p>
Responds with a suitable GIF into the same room as the command.
</p>

285
pkg/github.com/matrix-org/go-neb/services/github/index.html

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#375EAB"> <meta name="theme-color" content="#375EAB">
<title>services - The Go Programming Language</title>
<title>github - The Go Programming Language</title>
<link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css"> <link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css">
@ -42,7 +42,7 @@
<div class="container"> <div class="container">
<h1>Package services</h1>
<h1>Package github</h1>
@ -89,6 +89,13 @@
</div> </div>
<div class="expanded"> <div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2> <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
<p>
Package github implements a command service and a webhook service for interacting with Github.
</p>
<p>
The command service is a service which adds !commands and issue expansions for Github. The
webhook service adds Github webhook support.
</p>
</div> </div>
</div> </div>
@ -105,10 +112,40 @@
<div id="manual-nav"> <div id="manual-nav">
<dl> <dl>
<dd><a href="index.html#pkg-constants">Constants</a></dd>
<dd><a href="index.html#Service">type Service</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.Commands">func (s *Service) Commands(cli *matrix.Client, roomID string) []types.Command</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.Expansions">func (s *Service) Expansions(cli *matrix.Client, roomID string) []types.Expansion</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.Register">func (s *Service) Register(oldService types.Service, client *matrix.Client) error</a></dd>
<dd><a href="index.html#WebhookService">type WebhookService</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#WebhookService.OnReceiveWebhook">func (s *WebhookService) OnReceiveWebhook(w http.ResponseWriter, req *http.Request, cli *matrix.Client)</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#WebhookService.PostRegister">func (s *WebhookService) PostRegister(oldService types.Service)</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#WebhookService.Register">func (s *WebhookService) Register(oldService types.Service, client *matrix.Client) error</a></dd>
</dl> </dl>
</div><!-- #manual-nav --> </div><!-- #manual-nav -->
@ -167,6 +204,250 @@
</div> <!-- #pkg-callgraph --> </div> <!-- #pkg-callgraph -->
<h2 id="pkg-constants">Constants</h2>
<pre>const <span id="ServiceType">ServiceType</span> = &#34;github&#34;</pre>
<p>
ServiceType of the Github service
</p>
<pre>const <span id="WebhookServiceType">WebhookServiceType</span> = &#34;github-webhook&#34;</pre>
<p>
WebhookServiceType of the Github Webhook service.
</p>
<h2 id="Service">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/github/github.go?s=1569:1766#L41">Service</a></h2>
<pre>type Service struct {
<a href="../../types/index.html">types</a>.<a href="../../types/index.html#DefaultService">DefaultService</a>
<span class="comment">// The ID of an existing &#34;github&#34; realm. This realm will be used to obtain</span>
<span class="comment">// credentials of users when they create issues on Github.</span>
RealmID <a href="../../../../../builtin/index.html#string">string</a>
}</pre>
<p>
Service contains the Config fields for the Github service.
</p>
<p>
Before you can set up a Github Service, you need to set up a Github Realm. This
service requires a syncing client.
</p>
<p>
You can set a &#34;default repository&#34; for a Matrix room by sending a `m.room.bot.options` state event
which has the following `content`:
</p>
<pre>{
&#34;github&#34;: {
&#34;default_repo&#34;: &#34;owner/repo&#34;
}
}
</pre>
<p>
This will allow the &#34;owner/repo&#34; to be omitted when creating/expanding issues.
</p>
<p>
Example:
</p>
<pre>{
&#34;RealmID&#34;: &#34;github-realm-id&#34;
}
</pre>
<h3 id="Service.Commands">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/github/github.go?s=5003:5080#L148">Commands</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) Commands(cli *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>, roomID <a href="../../../../../builtin/index.html#string">string</a>) []<a href="../../types/index.html">types</a>.<a href="../../types/index.html#Command">Command</a></pre>
<p>
Commands supported:
</p>
<pre>!github create owner/repo &#34;issue title&#34; &#34;optional issue description&#34;
</pre>
<p>
Responds with the outcome of the issue creation request. This command requires
a Github account to be linked to the Matrix user ID issuing the command. If there
is no link, it will return a Starter Link instead.
</p>
<h3 id="Service.Expansions">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/github/github.go?s=5557:5638#L165">Expansions</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) Expansions(cli *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>, roomID <a href="../../../../../builtin/index.html#string">string</a>) []<a href="../../types/index.html">types</a>.<a href="../../types/index.html#Expansion">Expansion</a></pre>
<p>
Expansions expands strings of the form:
</p>
<pre>owner/repo#12
</pre>
<p>
Where #12 is an issue number or pull request. If there is a default repository set on the room,
it will also expand strings of the form:
</p>
<pre>#12
</pre>
<p>
using the default repository.
</p>
<h3 id="Service.Register">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/github/github.go?s=7243:7324#L214">Register</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) Register(oldService <a href="../../types/index.html">types</a>.<a href="../../types/index.html#Service">Service</a>, client *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>) <a href="../../../../../builtin/index.html#error">error</a></pre>
<p>
Register makes sure that the given realm ID maps to a github realm.
</p>
<h2 id="WebhookService">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/github/github_webhook.go?s=1314:2534#L35">WebhookService</a></h2>
<pre>type WebhookService struct {
<a href="../../types/index.html">types</a>.<a href="../../types/index.html#DefaultService">DefaultService</a>
<span class="comment">// The user ID to create/delete webhooks as.</span>
ClientUserID <a href="../../../../../builtin/index.html#string">string</a>
<span class="comment">// The ID of an existing &#34;github&#34; realm. This realm will be used to obtain</span>
<span class="comment">// the Github credentials of the ClientUserID.</span>
RealmID <a href="../../../../../builtin/index.html#string">string</a>
<span class="comment">// A map from Matrix room ID to Github &#34;owner/repo&#34;-style repositories.</span>
Rooms map[<a href="../../../../../builtin/index.html#string">string</a>]struct {
<span class="comment">// A map of &#34;owner/repo&#34;-style repositories to the events to listen for.</span>
Repos map[<a href="../../../../../builtin/index.html#string">string</a>]struct {
<span class="comment">// The webhook events to listen for. Currently supported:</span>
<span class="comment">// push : When users push to this repository.</span>
<span class="comment">// pull_request : When a pull request is made to this repository.</span>
<span class="comment">// issues : When an issue is opened/closed.</span>
<span class="comment">// issue_comment : When an issue or pull request is commented on.</span>
<span class="comment">// pull_request_review_comment : When a line comment is made on a pull request.</span>
<span class="comment">// Full list: https://developer.github.com/webhooks/#events</span>
Events []<a href="../../../../../builtin/index.html#string">string</a>
}
}
<span class="comment">// Optional. The secret token to supply when creating the webhook. If supplied,</span>
<span class="comment">// Go-NEB will perform security checks on incoming webhook requests using this token.</span>
SecretToken <a href="../../../../../builtin/index.html#string">string</a>
<span class="comment">// contains filtered or unexported fields</span>
}</pre>
<p>
WebhookService contains the Config fields for the Github Webhook Service.
</p>
<p>
Before you can set up a Github Service, you need to set up a Github Realm. This
service does not require a syncing client.
</p>
<p>
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.
</p>
<p>
Example:
</p>
<pre>{
ClientUserID: &#34;@alice:localhost&#34;,
RealmID: &#34;github-realm-id&#34;,
Rooms: {
&#34;!qmElAGdFYCHoCJuaNt:localhost&#34;: {
Repos: {
&#34;matrix-org/go-neb&#34;: {
Events: [&#34;push&#34;, &#34;issues&#34;, &#34;pull_request&#34;]
}
}
}
}
}
</pre>
<h3 id="WebhookService.OnReceiveWebhook">func (*WebhookService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/github/github_webhook.go?s=2984:3087#L70">OnReceiveWebhook</a></h3>
<pre>func (s *<a href="index.html#WebhookService">WebhookService</a>) OnReceiveWebhook(w <a href="../../../../../net/http/index.html">http</a>.<a href="../../../../../net/http/index.html#ResponseWriter">ResponseWriter</a>, req *<a href="../../../../../net/http/index.html">http</a>.<a href="../../../../../net/http/index.html#Request">Request</a>, cli *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>)</pre>
<p>
OnReceiveWebhook receives requests from Github and possibly sends requests to Matrix as a result.
</p>
<p>
If the &#34;owner/repo&#34; string in the webhook request case-insensitively matches a repo in this Service
config AND the event type matches an event type registered for that repo, then a message will be sent
into Matrix.
</p>
<p>
If the &#34;owner/repo&#34; string doesn&#39;t exist in this Service config, then the webhook will be deleted from
Github.
</p>
<h3 id="WebhookService.PostRegister">func (*WebhookService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/github/github_webhook.go?s=7141:7204#L197">PostRegister</a></h3>
<pre>func (s *<a href="index.html#WebhookService">WebhookService</a>) PostRegister(oldService <a href="../../types/index.html">types</a>.<a href="../../types/index.html#Service">Service</a>)</pre>
<p>
PostRegister cleans up removed repositories from the old service by
working out the delta between the old and new hooks.
</p>
<h3 id="WebhookService.Register">func (*WebhookService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/github/github_webhook.go?s=5139:5227#L135">Register</a></h3>
<pre>func (s *<a href="index.html#WebhookService">WebhookService</a>) Register(oldService <a href="../../types/index.html">types</a>.<a href="../../types/index.html#Service">Service</a>, client *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>) <a href="../../../../../builtin/index.html#error">error</a></pre>
<p>
Register will create webhooks for the repos specified in Rooms
</p>
<p>
The hooks made are a delta between the old service and the current configuration. If all webhooks are made,
Register() succeeds. If any webhook fails to be created, Register() fails. A delta is used to allow clients to incrementally
build up the service config without recreating the hooks every time a change is made.
</p>
<p>
Hooks are deleted when this service receives a webhook event from Github for a repo which has no user configurations.
</p>
<p>
Hooks can get out of sync if a user manually deletes a hook in the Github UI. In this case, toggling the repo configuration will
force NEB to recreate the hook.
</p>

74
pkg/github.com/matrix-org/go-neb/services/guggy/index.html

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#375EAB"> <meta name="theme-color" content="#375EAB">
<title>services - The Go Programming Language</title>
<title>guggy - The Go Programming Language</title>
<link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css"> <link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css">
@ -42,7 +42,7 @@
<div class="container"> <div class="container">
<h1>Package services</h1>
<h1>Package guggy</h1>
@ -87,6 +87,9 @@
</div> </div>
<div class="expanded"> <div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2> <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
<p>
Package guggy implements a Service which adds !commands for Guggy.
</p>
</div> </div>
</div> </div>
@ -103,10 +106,20 @@
<div id="manual-nav"> <div id="manual-nav">
<dl> <dl>
<dd><a href="index.html#pkg-constants">Constants</a></dd>
<dd><a href="index.html#Service">type Service</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.Commands">func (s *Service) Commands(client *matrix.Client, roomID string) []types.Command</a></dd>
</dl> </dl>
</div><!-- #manual-nav --> </div><!-- #manual-nav -->
@ -163,6 +176,63 @@
</div> <!-- #pkg-callgraph --> </div> <!-- #pkg-callgraph -->
<h2 id="pkg-constants">Constants</h2>
<pre>const <span id="ServiceType">ServiceType</span> = &#34;guggy&#34;</pre>
<p>
ServiceType of the Guggy service
</p>
<h2 id="Service">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/guggy/guggy.go?s=768:910#L31">Service</a></h2>
<pre>type Service struct {
<a href="../../types/index.html">types</a>.<a href="../../types/index.html#DefaultService">DefaultService</a>
<span class="comment">// The Guggy API key to use when making HTTP requests to Guggy.</span>
APIKey <a href="../../../../../builtin/index.html#string">string</a> `json:&#34;api_key&#34;`
}</pre>
<p>
Service contains the Config fields for the Guggy service.
</p>
<p>
Example:
</p>
<pre>{
&#34;api_key&#34;: &#34;fkweugfyuwegfweyg&#34;
}
</pre>
<h3 id="Service.Commands">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/guggy/guggy.go?s=1048:1128#L40">Commands</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) Commands(client *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>, roomID <a href="../../../../../builtin/index.html#string">string</a>) []<a href="../../types/index.html">types</a>.<a href="../../types/index.html#Command">Command</a></pre>
<p>
Commands supported:
</p>
<pre>!guggy some search query without quotes
</pre>
<p>
Responds with a suitable GIF into the same room as the command.
</p>

12
pkg/github.com/matrix-org/go-neb/services/index.html

@ -91,7 +91,7 @@
<a href="echo/index.html">echo</a> <a href="echo/index.html">echo</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package echo implements a Service which echoes back !commands.
</td> </td>
</tr> </tr>
@ -102,7 +102,7 @@
<a href="giphy/index.html">giphy</a> <a href="giphy/index.html">giphy</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package giphy implements a Service which adds !commands for Giphy.
</td> </td>
</tr> </tr>
@ -113,7 +113,7 @@
<a href="github/index.html">github</a> <a href="github/index.html">github</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package github implements a command service and a webhook service for interacting with Github.
</td> </td>
</tr> </tr>
@ -146,7 +146,7 @@
<a href="guggy/index.html">guggy</a> <a href="guggy/index.html">guggy</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package guggy implements a Service which adds !commands for Guggy.
</td> </td>
</tr> </tr>
@ -157,7 +157,7 @@
<a href="jira/index.html">jira</a> <a href="jira/index.html">jira</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package jira implements a command and webhook service for interacting with JIRA.
</td> </td>
</tr> </tr>
@ -179,7 +179,7 @@
<a href="rssbot/index.html">rssbot</a> <a href="rssbot/index.html">rssbot</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package rssbot implements a Service capable of reading Atom/RSS feeds.
</td> </td>
</tr> </tr>

165
pkg/github.com/matrix-org/go-neb/services/jira/index.html

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#375EAB"> <meta name="theme-color" content="#375EAB">
<title>services - The Go Programming Language</title>
<title>jira - The Go Programming Language</title>
<link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css"> <link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css">
@ -42,7 +42,7 @@
<div class="container"> <div class="container">
<h1>Package services</h1>
<h1>Package jira</h1>
@ -89,6 +89,12 @@
</div> </div>
<div class="expanded"> <div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2> <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
<p>
Package jira implements a command and webhook service for interacting with JIRA.
</p>
<p>
The service adds !commands and issue expansions, in addition to JIRA webhook support.
</p>
</div> </div>
</div> </div>
@ -105,10 +111,29 @@
<div id="manual-nav"> <div id="manual-nav">
<dl> <dl>
<dd><a href="index.html#pkg-constants">Constants</a></dd>
<dd><a href="index.html#Service">type Service</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.Commands">func (s *Service) Commands(cli *matrix.Client, roomID string) []types.Command</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.Expansions">func (s *Service) Expansions(cli *matrix.Client, roomID string) []types.Expansion</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.OnReceiveWebhook">func (s *Service) OnReceiveWebhook(w http.ResponseWriter, req *http.Request, cli *matrix.Client)</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.Register">func (s *Service) Register(oldService types.Service, client *matrix.Client) error</a></dd>
</dl> </dl>
</div><!-- #manual-nav --> </div><!-- #manual-nav -->
@ -165,6 +190,142 @@
</div> <!-- #pkg-callgraph --> </div> <!-- #pkg-callgraph -->
<h2 id="pkg-constants">Constants</h2>
<pre>const <span id="ServiceType">ServiceType</span> = &#34;jira&#34;</pre>
<p>
ServiceType of the JIRA Service
</p>
<h2 id="Service">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/jira/jira.go?s=1402:2124#L41">Service</a></h2>
<pre>type Service struct {
<a href="../../types/index.html">types</a>.<a href="../../types/index.html#DefaultService">DefaultService</a>
<span class="comment">// The user ID to create issues as, or to create/delete webhooks as. This user</span>
<span class="comment">// is also used to look up issues for expansions.</span>
ClientUserID <a href="../../../../../builtin/index.html#string">string</a>
<span class="comment">// A map from Matrix room ID to JIRA realms and project keys.</span>
Rooms map[<a href="../../../../../builtin/index.html#string">string</a>]struct {
<span class="comment">// A map of realm IDs to project keys. The realm IDs determine the JIRA</span>
<span class="comment">// endpoint used.</span>
Realms map[<a href="../../../../../builtin/index.html#string">string</a>]struct {
<span class="comment">// A map of project keys e.g. &#34;SYN&#34; to config options.</span>
Projects map[<a href="../../../../../builtin/index.html#string">string</a>]struct {
<span class="comment">// True to expand issues with this key e.g &#34;SYN-123&#34; will be expanded.</span>
Expand <a href="../../../../../builtin/index.html#bool">bool</a>
<span class="comment">// True to add a webhook to this project and send updates into the room.</span>
Track <a href="../../../../../builtin/index.html#bool">bool</a>
}
}
}
<span class="comment">// contains filtered or unexported fields</span>
}</pre>
<p>
Service contains the Config fields for the JIRA service.
</p>
<p>
Before you can set up a JIRA Service, you need to set up a JIRA Realm.
</p>
<p>
Example:
</p>
<pre>{
Rooms: {
&#34;!qmElAGdFYCHoCJuaNt:localhost&#34;: {
Realms: {
&#34;jira-realm-id&#34;: {
Projects: {
&#34;SYN&#34;: { Expand: true },
&#34;BOTS&#34;: { Expand: true, Track: true }
}
}
}
}
}
}
</pre>
<h3 id="Service.Commands">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/jira/jira.go?s=7320:7397#L231">Commands</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) Commands(cli *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>, roomID <a href="../../../../../builtin/index.html#string">string</a>) []<a href="../../types/index.html">types</a>.<a href="../../types/index.html#Command">Command</a></pre>
<p>
Commands supported:
</p>
<pre>!jira create KEY &#34;issue title&#34; &#34;optional issue description&#34;
</pre>
<p>
Responds with the outcome of the issue creation request. This command requires
a JIRA account to be linked to the Matrix user ID issuing the command. It also
requires there to be a project with the given project key (e.g. &#34;KEY&#34;) to exist
on the linked JIRA account. If there are multiple JIRA accounts which contain the
same project key, which project is chosen is undefined. If there
is no JIRA account linked to the Matrix user ID, it will return a Starter Link
if there is a known public project with that project key.
</p>
<h3 id="Service.Expansions">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/jira/jira.go?s=7979:8060#L248">Expansions</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) Expansions(cli *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>, roomID <a href="../../../../../builtin/index.html#string">string</a>) []<a href="../../types/index.html">types</a>.<a href="../../types/index.html#Expansion">Expansion</a></pre>
<p>
Expansions expands JIRA issues represented as:
</p>
<pre>KEY-12
</pre>
<p>
Where &#34;KEY&#34; is the project key and 12&#34; is an issue number. The Service Config will be used
to map the project key to a realm, and subsequently the JIRA endpoint to hit.
If there are multiple projects with the same project key in the Service Config, one will
be chosen arbitrarily.
</p>
<h3 id="Service.OnReceiveWebhook">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/jira/jira.go?s=8386:8482#L260">OnReceiveWebhook</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) OnReceiveWebhook(w <a href="../../../../../net/http/index.html">http</a>.<a href="../../../../../net/http/index.html#ResponseWriter">ResponseWriter</a>, req *<a href="../../../../../net/http/index.html">http</a>.<a href="../../../../../net/http/index.html#Request">Request</a>, cli *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>)</pre>
<p>
OnReceiveWebhook receives requests from JIRA and possibly sends requests to Matrix as a result.
</p>
<h3 id="Service.Register">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/jira/jira.go?s=2246:2327#L65">Register</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) Register(oldService <a href="../../types/index.html">types</a>.<a href="../../types/index.html#Service">Service</a>, client *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>) <a href="../../../../../builtin/index.html#error">error</a></pre>
<p>
Register ensures that the given realm IDs are valid JIRA realms and registers webhooks
with those JIRA endpoints.
</p>

132
pkg/github.com/matrix-org/go-neb/services/rssbot/index.html

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#375EAB"> <meta name="theme-color" content="#375EAB">
<title>services - The Go Programming Language</title>
<title>rssbot - The Go Programming Language</title>
<link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css"> <link type="text/css" rel="stylesheet" href="../../../../../../lib/godoc/style.css">
@ -42,7 +42,7 @@
<div class="container"> <div class="container">
<h1>Package services</h1>
<h1>Package rssbot</h1>
@ -87,6 +87,9 @@
</div> </div>
<div class="expanded"> <div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2> <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
<p>
Package rssbot implements a Service capable of reading Atom/RSS feeds.
</p>
</div> </div>
</div> </div>
@ -103,10 +106,26 @@
<div id="manual-nav"> <div id="manual-nav">
<dl> <dl>
<dd><a href="index.html#pkg-constants">Constants</a></dd>
<dd><a href="index.html#Service">type Service</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.OnPoll">func (s *Service) OnPoll(cli *matrix.Client) time.Time</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.PostRegister">func (s *Service) PostRegister(oldService types.Service)</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Service.Register">func (s *Service) Register(oldService types.Service, client *matrix.Client) error</a></dd>
</dl> </dl>
</div><!-- #manual-nav --> </div><!-- #manual-nav -->
@ -163,6 +182,115 @@
</div> <!-- #pkg-callgraph --> </div> <!-- #pkg-callgraph -->
<h2 id="pkg-constants">Constants</h2>
<pre>const <span id="ServiceType">ServiceType</span> = &#34;rssbot&#34;</pre>
<p>
ServiceType of the RSS Bot service
</p>
<h2 id="Service">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go?s=1294:2255#L42">Service</a></h2>
<pre>type Service struct {
<a href="../../types/index.html">types</a>.<a href="../../types/index.html#DefaultService">DefaultService</a>
<span class="comment">// Feeds is a map of feed URL to configuration options for this feed.</span>
Feeds map[<a href="../../../../../builtin/index.html#string">string</a>]struct {
<span class="comment">// Optional. The time to wait between polls. If this is less than minPollingIntervalSeconds, it is ignored.</span>
PollIntervalMins <a href="../../../../../builtin/index.html#int">int</a> `json:&#34;poll_interval_mins&#34;`
<span class="comment">// The list of rooms to send feed updates into. This cannot be empty.</span>
Rooms []<a href="../../../../../builtin/index.html#string">string</a> `json:&#34;rooms&#34;`
<span class="comment">// True if rss bot is unable to poll this feed. This is populated by Go-NEB. Use /getService to</span>
<span class="comment">// retrieve this value.</span>
IsFailing <a href="../../../../../builtin/index.html#bool">bool</a> `json:&#34;is_failing&#34;`
<span class="comment">// The time of the last successful poll. This is populated by Go-NEB. Use /getService to retrieve</span>
<span class="comment">// this value.</span>
FeedUpdatedTimestampSecs <a href="../../../../../builtin/index.html#int64">int64</a> `json:&#34;last_updated_ts_secs&#34;`
<span class="comment">// Internal field. When we should poll again.</span>
NextPollTimestampSecs <a href="../../../../../builtin/index.html#int64">int64</a>
<span class="comment">// Internal field. The most recently seen GUIDs. Sized to the number of items in the feed.</span>
RecentGUIDs []<a href="../../../../../builtin/index.html#string">string</a>
} `json:&#34;feeds&#34;`
}</pre>
<p>
Service contains the Config fields for this service.
</p>
<p>
Example:
</p>
<pre>{
feeds: {
&#34;<a href="http://rss.cnn.com/rss/edition.rss">http://rss.cnn.com/rss/edition.rss</a>&#34;: {
poll_interval_mins: 60,
rooms: [&#34;!cBrPbzWazCtlkMNQSF:localhost&#34;]
},
&#34;<a href="https://www.wired.com/feed/">https://www.wired.com/feed/</a>&#34;: {
rooms: [&#34;!qmElAGdFYCHoCJuaNt:localhost&#34;]
}
}
}
</pre>
<h3 id="Service.OnPoll">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go?s=4838:4892#L139">OnPoll</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) OnPoll(cli *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>) <a href="../../../../../time/index.html">time</a>.<a href="../../../../../time/index.html#Time">Time</a></pre>
<p>
OnPoll rechecks RSS feeds which are due to be polled.
</p>
<p>
In order for a feed to be polled, the current time must be greater than NextPollTimestampSecs.
In order for an item on a feed to be sent to Matrix, the item&#39;s GUID must not exist in RecentGUIDs.
The GUID for an item is created according to the following rules:
</p>
<pre>- If there is a GUID field, use it.
- Else if there is a Link field, use it as the GUID.
- Else if there is a Title field, use it as the GUID.
</pre>
<p>
Returns a timestamp representing when this Service should have OnPoll called again.
</p>
<h3 id="Service.PostRegister">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go?s=3821:3877#L115">PostRegister</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) PostRegister(oldService <a href="../../types/index.html">types</a>.<a href="../../types/index.html#Service">Service</a>)</pre>
<p>
PostRegister deletes this service if there are no feeds remaining.
</p>
<h3 id="Service.Register">func (*Service) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go?s=2368:2449#L64">Register</a></h3>
<pre>func (s *<a href="index.html#Service">Service</a>) Register(oldService <a href="../../types/index.html">types</a>.<a href="../../types/index.html#Service">Service</a>, client *<a href="../../matrix/index.html">matrix</a>.<a href="../../matrix/index.html#Client">Client</a>) <a href="../../../../../builtin/index.html#error">error</a></pre>
<p>
Register will check the liveness of each RSS feed given. If all feeds check out okay, no error is returned.
</p>

211
pkg/github.com/matrix-org/go-neb/types/index.html

@ -137,14 +137,28 @@
<dd><a href="index.html#Command">type Command</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Command.Matches">func (command *Command) Matches(arguments []string) bool</a></dd>
<dd><a href="index.html#DefaultService">type DefaultService</a></dd> <dd><a href="index.html#DefaultService">type DefaultService</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#NewDefaultService">func NewDefaultService(serviceID, serviceUserID, serviceType string) DefaultService</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#DefaultService.OnReceiveWebhook">func (s *DefaultService) OnReceiveWebhook(w http.ResponseWriter, req *http.Request, cli *matrix.Client)</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#DefaultService.Commands">func (s *DefaultService) Commands(cli *matrix.Client, roomID string) []Command</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#DefaultService.Plugin">func (s *DefaultService) Plugin(cli *matrix.Client, roomID string) plugin.Plugin</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#DefaultService.Expansions">func (s *DefaultService) Expansions(cli *matrix.Client, roomID string) []Expansion</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#DefaultService.OnReceiveWebhook">func (s *DefaultService) OnReceiveWebhook(w http.ResponseWriter, req *http.Request, cli *matrix.Client)</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#DefaultService.PostRegister">func (s *DefaultService) PostRegister(oldService Service)</a></dd> <dd>&nbsp; &nbsp; <a href="index.html#DefaultService.PostRegister">func (s *DefaultService) PostRegister(oldService Service)</a></dd>
@ -153,6 +167,20 @@
<dd>&nbsp; &nbsp; <a href="index.html#DefaultService.Register">func (s *DefaultService) Register(oldService Service, client *matrix.Client) error</a></dd> <dd>&nbsp; &nbsp; <a href="index.html#DefaultService.Register">func (s *DefaultService) Register(oldService Service, client *matrix.Client) error</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#DefaultService.ServiceID">func (s *DefaultService) ServiceID() string</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#DefaultService.ServiceType">func (s *DefaultService) ServiceType() string</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#DefaultService.ServiceUserID">func (s *DefaultService) ServiceUserID() string</a></dd>
<dd><a href="index.html#Expansion">type Expansion</a></dd>
<dd><a href="index.html#Poller">type Poller</a></dd> <dd><a href="index.html#Poller">type Poller</a></dd>
@ -177,7 +205,11 @@
<p> <p>
<span style="font-size:90%"> <span style="font-size:90%">
<a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go">types.go</a>
<a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/actions.go">actions.go</a>
<a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/auth.go">auth.go</a>
<a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go">service.go</a>
</span> </span>
</p> </p>
@ -227,7 +259,7 @@
<h2 id="BaseURL">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=2904:2932#L64">BaseURL</a></h2>
<h2 id="BaseURL">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=4311:4339#L99">BaseURL</a></h2>
<pre>func BaseURL(u <a href="../../../../builtin/index.html#string">string</a>) <a href="../../../../builtin/index.html#error">error</a></pre> <pre>func BaseURL(u <a href="../../../../builtin/index.html#string">string</a>) <a href="../../../../builtin/index.html#error">error</a></pre>
<p> <p>
BaseURL sets the base URL of NEB to the url given. This URL must be accessible from the BaseURL sets the base URL of NEB to the url given. This URL must be accessible from the
@ -240,7 +272,7 @@ public internet.
<h2 id="PollingServiceTypes">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=3709:3752#L92">PollingServiceTypes</a></h2>
<h2 id="PollingServiceTypes">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=5116:5159#L127">PollingServiceTypes</a></h2>
<pre>func PollingServiceTypes() (types []<a href="../../../../builtin/index.html#string">string</a>)</pre> <pre>func PollingServiceTypes() (types []<a href="../../../../builtin/index.html#string">string</a>)</pre>
<p> <p>
PollingServiceTypes returns a list of service types which meet the Poller interface PollingServiceTypes returns a list of service types which meet the Poller interface
@ -252,7 +284,7 @@ PollingServiceTypes returns a list of service types which meet the Poller interf
<h2 id="RegisterAuthRealm">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=5063:5125#L131">RegisterAuthRealm</a></h2>
<h2 id="RegisterAuthRealm">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/auth.go?s=654:716#L15">RegisterAuthRealm</a></h2>
<pre>func RegisterAuthRealm(factory func(<a href="../../../../builtin/index.html#string">string</a>, <a href="../../../../builtin/index.html#string">string</a>) <a href="index.html#AuthRealm">AuthRealm</a>)</pre> <pre>func RegisterAuthRealm(factory func(<a href="../../../../builtin/index.html#string">string</a>, <a href="../../../../builtin/index.html#string">string</a>) <a href="index.html#AuthRealm">AuthRealm</a>)</pre>
<p> <p>
RegisterAuthRealm registers a factory for creating AuthRealm instances. RegisterAuthRealm registers a factory for creating AuthRealm instances.
@ -264,7 +296,7 @@ RegisterAuthRealm registers a factory for creating AuthRealm instances.
<h2 id="RegisterService">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=3399:3465#L82">RegisterService</a></h2>
<h2 id="RegisterService">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=4806:4872#L117">RegisterService</a></h2>
<pre>func RegisterService(factory func(<a href="../../../../builtin/index.html#string">string</a>, <a href="../../../../builtin/index.html#string">string</a>, <a href="../../../../builtin/index.html#string">string</a>) <a href="index.html#Service">Service</a>)</pre> <pre>func RegisterService(factory func(<a href="../../../../builtin/index.html#string">string</a>, <a href="../../../../builtin/index.html#string">string</a>, <a href="../../../../builtin/index.html#string">string</a>) <a href="index.html#Service">Service</a>)</pre>
<p> <p>
RegisterService registers a factory for creating Service instances. RegisterService registers a factory for creating Service instances.
@ -277,7 +309,7 @@ RegisterService registers a factory for creating Service instances.
<h2 id="AuthRealm">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=4649:4922#L118">AuthRealm</a></h2>
<h2 id="AuthRealm">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/auth.go?s=240:513#L2">AuthRealm</a></h2>
<pre>type AuthRealm interface { <pre>type AuthRealm interface {
ID() <a href="../../../../builtin/index.html#string">string</a> ID() <a href="../../../../builtin/index.html#string">string</a>
Type() <a href="../../../../builtin/index.html#string">string</a> Type() <a href="../../../../builtin/index.html#string">string</a>
@ -303,7 +335,7 @@ This may static (like github.com) or a specific domain (like matrix.org/jira)
<h3 id="CreateAuthRealm">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=5340:5424#L137">CreateAuthRealm</a></h3>
<h3 id="CreateAuthRealm">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/auth.go?s=931:1015#L21">CreateAuthRealm</a></h3>
<pre>func CreateAuthRealm(realmID, realmType <a href="../../../../builtin/index.html#string">string</a>, realmJSON []<a href="../../../../builtin/index.html#byte">byte</a>) (<a href="index.html#AuthRealm">AuthRealm</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre> <pre>func CreateAuthRealm(realmID, realmType <a href="../../../../builtin/index.html#string">string</a>, realmJSON []<a href="../../../../builtin/index.html#byte">byte</a>) (<a href="index.html#AuthRealm">AuthRealm</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre>
<p> <p>
CreateAuthRealm creates an AuthRealm of the given type and realm ID. CreateAuthRealm creates an AuthRealm of the given type and realm ID.
@ -318,7 +350,7 @@ Returns an error if the realm couldn&#39;t be created or the JSON cannot be unma
<h2 id="AuthSession">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=5943:6063#L156">AuthSession</a></h2>
<h2 id="AuthSession">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/auth.go?s=1534:1654#L40">AuthSession</a></h2>
<pre>type AuthSession interface { <pre>type AuthSession interface {
ID() <a href="../../../../builtin/index.html#string">string</a> ID() <a href="../../../../builtin/index.html#string">string</a>
UserID() <a href="../../../../builtin/index.html#string">string</a> UserID() <a href="../../../../builtin/index.html#string">string</a>
@ -346,7 +378,7 @@ an auth realm.
<h2 id="BotOptions">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=233:355#L5">BotOptions</a></h2>
<h2 id="BotOptions">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=195:317#L5">BotOptions</a></h2>
<pre>type BotOptions struct { <pre>type BotOptions struct {
RoomID <a href="../../../../builtin/index.html#string">string</a> RoomID <a href="../../../../builtin/index.html#string">string</a>
UserID <a href="../../../../builtin/index.html#string">string</a> UserID <a href="../../../../builtin/index.html#string">string</a>
@ -372,8 +404,50 @@ BotOptions for a given bot user in a given room
<h2 id="DefaultService">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=2167:2195#L42">DefaultService</a></h2>
<pre>type DefaultService struct{}</pre>
<h2 id="Command">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/actions.go?s=330:503#L1">Command</a></h2>
<pre>type Command struct {
Path []<a href="../../../../builtin/index.html#string">string</a>
Arguments []<a href="../../../../builtin/index.html#string">string</a>
Help <a href="../../../../builtin/index.html#string">string</a>
Command func(roomID, userID <a href="../../../../builtin/index.html#string">string</a>, arguments []<a href="../../../../builtin/index.html#string">string</a>) (content interface{}, err <a href="../../../../builtin/index.html#error">error</a>)
}</pre>
<p>
A Command is something that a user invokes by sending a message starting with &#39;!&#39;
followed by a list of strings that name the command, followed by a list of argument
strings. The argument strings may be quoted using &#39;\&#34;&#39; and &#39;\&rdquo; in the same way
that they are quoted in the unix shell.
</p>
<h3 id="Command.Matches">func (*Command) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/actions.go?s=946:1002#L16">Matches</a></h3>
<pre>func (command *<a href="index.html#Command">Command</a>) Matches(arguments []<a href="../../../../builtin/index.html#string">string</a>) <a href="../../../../builtin/index.html#bool">bool</a></pre>
<p>
Matches if the arguments start with the path of the command.
</p>
<h2 id="DefaultService">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=2186:2282#L43">DefaultService</a></h2>
<pre>type DefaultService struct {
<span class="comment">// contains filtered or unexported fields</span>
}</pre>
<p> <p>
DefaultService NO-OPs the implementation of optional Service interface methods. Feel free to override them. DefaultService NO-OPs the implementation of optional Service interface methods. Feel free to override them.
</p> </p>
@ -389,12 +463,22 @@ DefaultService NO-OPs the implementation of optional Service interface methods.
<h3 id="NewDefaultService">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=2399:2482#L50">NewDefaultService</a></h3>
<pre>func NewDefaultService(serviceID, serviceUserID, serviceType <a href="../../../../builtin/index.html#string">string</a>) <a href="index.html#DefaultService">DefaultService</a></pre>
<p>
NewDefaultService creates a new service with implementations for ServiceID(), ServiceType() and ServiceUserID()
</p>
<h3 id="DefaultService.OnReceiveWebhook">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=2632:2735#L56">OnReceiveWebhook</a></h3>
<pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) OnReceiveWebhook(w <a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#ResponseWriter">ResponseWriter</a>, req *<a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#Request">Request</a>, cli *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>)</pre>
<h3 id="DefaultService.Commands">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=3493:3571#L75">Commands</a></h3>
<pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) Commands(cli *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>, roomID <a href="../../../../builtin/index.html#string">string</a>) []<a href="index.html#Command">Command</a></pre>
<p> <p>
OnReceiveWebhook does nothing but 200 OK the request.
Commands returns no commands.
</p> </p>
@ -402,10 +486,10 @@ OnReceiveWebhook does nothing but 200 OK the request.
<h3 id="DefaultService.Plugin">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=2227:2307#L45">Plugin</a></h3>
<pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) Plugin(cli *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>, roomID <a href="../../../../builtin/index.html#string">string</a>) <a href="../plugin/index.html">plugin</a>.<a href="../plugin/index.html#Plugin">Plugin</a></pre>
<h3 id="DefaultService.Expansions">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=3634:3716#L80">Expansions</a></h3>
<pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) Expansions(cli *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>, roomID <a href="../../../../builtin/index.html#string">string</a>) []<a href="index.html#Expansion">Expansion</a></pre>
<p> <p>
Plugin returns no plugins.
Expansions returns no expansions.
</p> </p>
@ -413,7 +497,18 @@ Plugin returns no plugins.
<h3 id="DefaultService.PostRegister">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=2513:2570#L53">PostRegister</a></h3>
<h3 id="DefaultService.OnReceiveWebhook">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=4039:4142#L91">OnReceiveWebhook</a></h3>
<pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) OnReceiveWebhook(w <a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#ResponseWriter">ResponseWriter</a>, req *<a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#Request">Request</a>, cli *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>)</pre>
<p>
OnReceiveWebhook does nothing but 200 OK the request.
</p>
<h3 id="DefaultService.PostRegister">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=3920:3977#L88">PostRegister</a></h3>
<pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) PostRegister(oldService <a href="index.html#Service">Service</a>)</pre> <pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) PostRegister(oldService <a href="index.html#Service">Service</a>)</pre>
<p> <p>
PostRegister does nothing. PostRegister does nothing.
@ -424,7 +519,7 @@ PostRegister does nothing.
<h3 id="DefaultService.Register">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=2384:2466#L50">Register</a></h3>
<h3 id="DefaultService.Register">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=3791:3873#L85">Register</a></h3>
<pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) Register(oldService <a href="index.html#Service">Service</a>, client *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>) <a href="../../../../builtin/index.html#error">error</a></pre> <pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) Register(oldService <a href="index.html#Service">Service</a>, client *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>) <a href="../../../../builtin/index.html#error">error</a></pre>
<p> <p>
Register does nothing and returns no error. Register does nothing and returns no error.
@ -435,9 +530,74 @@ Register does nothing and returns no error.
<h3 id="DefaultService.ServiceID">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=2728:2771#L56">ServiceID</a></h3>
<pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) ServiceID() <a href="../../../../builtin/index.html#string">string</a></pre>
<p>
ServiceID returns the service&#39;s ID. In order for this to return the ID, DefaultService MUST have been
initialised by NewDefaultService, the zero-initialiser is NOT enough.
</p>
<h3 id="DefaultService.ServiceType">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=3387:3432#L70">ServiceType</a></h3>
<pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) ServiceType() <a href="../../../../builtin/index.html#string">string</a></pre>
<p>
ServiceType returns the type of service. See each individual service package for the ServiceType constant
to find out what this value actually is. In order for this to return the Type, DefaultService MUST have been
initialised by NewDefaultService, the zero-initialiser is NOT enough.
</p>
<h3 id="DefaultService.ServiceUserID">func (*DefaultService) <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=3016:3063#L63">ServiceUserID</a></h3>
<pre>func (s *<a href="index.html#DefaultService">DefaultService</a>) ServiceUserID() <a href="../../../../builtin/index.html#string">string</a></pre>
<p>
ServiceUserID returns the user ID that the service sends events as. In order for this to return the
service user ID, DefaultService MUST have been initialised by NewDefaultService, the zero-initialiser
is NOT enough.
</p>
<h2 id="Expansion">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/actions.go?s=759:880#L10">Expansion</a></h2>
<pre>type Expansion struct {
Regexp *<a href="../../../../regexp/index.html">regexp</a>.<a href="../../../../regexp/index.html#Regexp">Regexp</a>
Expand func(roomID, userID <a href="../../../../builtin/index.html#string">string</a>, matchingGroups []<a href="../../../../builtin/index.html#string">string</a>) interface{}
}</pre>
<p>
An Expansion is something that actives when the user sends any message
containing a string matching a given pattern. For example an RFC expansion
might expand &#34;RFC 6214&#34; into &#34;Adaptation of RFC 1149 for IPv6&#34; and link to
the appropriate RFC.
</p>
<h2 id="Poller">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=470:680#L13">Poller</a></h2>
<h2 id="Poller">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=432:642#L13">Poller</a></h2>
<pre>type Poller interface { <pre>type Poller interface {
<span class="comment">// OnPoll is called when the poller should poll. Return the timestamp when you want to be polled again.</span> <span class="comment">// OnPoll is called when the poller should poll. Return the timestamp when you want to be polled again.</span>
<span class="comment">// Return 0 to never be polled again.</span> <span class="comment">// Return 0 to never be polled again.</span>
@ -462,7 +622,7 @@ Poller represents a thing which can poll. Services should implement this method
<h2 id="Service">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=735:2054#L20">Service</a></h2>
<h2 id="Service">type <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=697:2073#L20">Service</a></h2>
<pre>type Service interface { <pre>type Service interface {
<span class="comment">// Return the user ID of this service.</span> <span class="comment">// Return the user ID of this service.</span>
ServiceUserID() <a href="../../../../builtin/index.html#string">string</a> ServiceUserID() <a href="../../../../builtin/index.html#string">string</a>
@ -470,7 +630,8 @@ Poller represents a thing which can poll. Services should implement this method
ServiceID() <a href="../../../../builtin/index.html#string">string</a> ServiceID() <a href="../../../../builtin/index.html#string">string</a>
<span class="comment">// Return the type of service. This string MUST NOT change.</span> <span class="comment">// Return the type of service. This string MUST NOT change.</span>
ServiceType() <a href="../../../../builtin/index.html#string">string</a> ServiceType() <a href="../../../../builtin/index.html#string">string</a>
Plugin(cli *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>, roomID <a href="../../../../builtin/index.html#string">string</a>) <a href="../plugin/index.html">plugin</a>.<a href="../plugin/index.html#Plugin">Plugin</a>
Commands(cli *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>, roomID <a href="../../../../builtin/index.html#string">string</a>) []<a href="index.html#Command">Command</a>
Expansions(cli *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>, roomID <a href="../../../../builtin/index.html#string">string</a>) []<a href="index.html#Expansion">Expansion</a>
OnReceiveWebhook(w <a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#ResponseWriter">ResponseWriter</a>, req *<a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#Request">Request</a>, cli *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>) OnReceiveWebhook(w <a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#ResponseWriter">ResponseWriter</a>, req *<a href="../../../../net/http/index.html">http</a>.<a href="../../../../net/http/index.html#Request">Request</a>, cli *<a href="../matrix/index.html">matrix</a>.<a href="../matrix/index.html#Client">Client</a>)
<span class="comment">// A lifecycle function which is invoked when the service is being registered. The old service, if one exists, is provided,</span> <span class="comment">// A lifecycle function which is invoked when the service is being registered. The old service, if one exists, is provided,</span>
<span class="comment">// along with a Client instance for ServiceUserID(). If this function returns an error, the service will not be registered</span> <span class="comment">// along with a Client instance for ServiceUserID(). If this function returns an error, the service will not be registered</span>
@ -498,7 +659,7 @@ A Service is the configuration for a bot service.
<h3 id="CreateService">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/types.go?s=3960:4061#L101">CreateService</a></h3>
<h3 id="CreateService">func <a href="http://localhost:6060/src/github.com/matrix-org/go-neb/types/service.go?s=5367:5468#L136">CreateService</a></h3>
<pre>func CreateService(serviceID, serviceType, serviceUserID <a href="../../../../builtin/index.html#string">string</a>, serviceJSON []<a href="../../../../builtin/index.html#byte">byte</a>) (<a href="index.html#Service">Service</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre> <pre>func CreateService(serviceID, serviceType, serviceUserID <a href="../../../../builtin/index.html#string">string</a>, serviceJSON []<a href="../../../../builtin/index.html#byte">byte</a>) (<a href="index.html#Service">Service</a>, <a href="../../../../builtin/index.html#error">error</a>)</pre>
<p> <p>
CreateService creates a Service of the given type and serviceID. CreateService creates a Service of the given type and serviceID.

23
pkg/github.com/matrix-org/index.html

@ -185,17 +185,6 @@
<tr>
<td class="pkg-name" style="padding-left: 20px;">
<a href="go-neb/plugin/index.html">plugin</a>
</td>
<td class="pkg-synopsis">
</td>
</tr>
<tr> <tr>
<td class="pkg-name" style="padding-left: 20px;"> <td class="pkg-name" style="padding-left: 20px;">
<a href="go-neb/polling/index.html">polling</a> <a href="go-neb/polling/index.html">polling</a>
@ -278,7 +267,7 @@
<a href="go-neb/services/echo/index.html">echo</a> <a href="go-neb/services/echo/index.html">echo</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package echo implements a Service which echoes back !commands.
</td> </td>
</tr> </tr>
@ -289,7 +278,7 @@
<a href="go-neb/services/giphy/index.html">giphy</a> <a href="go-neb/services/giphy/index.html">giphy</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package giphy implements a Service which adds !commands for Giphy.
</td> </td>
</tr> </tr>
@ -300,7 +289,7 @@
<a href="go-neb/services/github/index.html">github</a> <a href="go-neb/services/github/index.html">github</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package github implements a command service and a webhook service for interacting with Github.
</td> </td>
</tr> </tr>
@ -333,7 +322,7 @@
<a href="go-neb/services/guggy/index.html">guggy</a> <a href="go-neb/services/guggy/index.html">guggy</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package guggy implements a Service which adds !commands for Guggy.
</td> </td>
</tr> </tr>
@ -344,7 +333,7 @@
<a href="go-neb/services/jira/index.html">jira</a> <a href="go-neb/services/jira/index.html">jira</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package jira implements a command and webhook service for interacting with JIRA.
</td> </td>
</tr> </tr>
@ -366,7 +355,7 @@
<a href="go-neb/services/rssbot/index.html">rssbot</a> <a href="go-neb/services/rssbot/index.html">rssbot</a>
</td> </td>
<td class="pkg-synopsis"> <td class="pkg-synopsis">
Package rssbot implements a Service capable of reading Atom/RSS feeds.
</td> </td>
</tr> </tr>

Loading…
Cancel
Save