Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial documentation

  • Loading branch information...
commit 7aa32f0b39d3eb971c3612f1a597579b6307c27c 0 parents
@edsrzf edsrzf authored
Showing with 571 additions and 0 deletions.
  1. +204 −0 all.css
  2. +190 −0 godocs.js
  3. +177 −0 index.html
204 all.css
@@ -0,0 +1,204 @@
+/* General Styles */
+body {
+ font-family: "Bitstream Vera Sans", Verdana, sans-serif;
+ font-size: 81.25%;
+ line-height: 1.23em;
+ padding: 0;
+ margin: 1.23em;
+ background: white;
+ color: black;
+}
+a {
+ color: #04a;
+ text-decoration: none;
+}
+a:visited {
+ color: #04a;
+}
+a:hover {
+ color: #a40;
+ text-decoration: underline;
+}
+a:active {
+ color: #c00;
+}
+code, pre {
+ font-size: 1.2em;
+}
+pre {
+ background: #F0F0F0;
+ padding: 0.5em 1em;
+}
+
+/* Top bar */
+#container {
+ width: 100%;
+ margin: auto;
+}
+#topnav {
+ height: 55px;
+ background: url(logo.png) no-repeat top left;
+}
+a#logo-box {
+ display: block;
+ height: 55px;
+}
+h1#title {
+ display: none;
+}
+#nav-main {
+ float: right;
+ width: 500px;
+ margin-top: -5px;
+ text-align: center;
+}
+#nav-main ul {
+ padding-left: 0;
+ margin-left: 0;
+ margin-bottom: 0.5em;
+}
+#nav-main li a {
+ display: inline;
+ display: inline-block;
+ padding: .46em .62em .38em .62em;
+}
+#nav-main li a:link,
+#nav-main li a:visited {
+ color: #000;
+}
+#nav-main li {
+ display: inline;
+ display: inline-block;
+ background: #e6e6e6 url(button_background.png) repeat-x;
+ border: solid 1px #999;
+ margin-left: -1px;
+ text-shadow: #fff 0 1px 0;
+ box-shadow: 0 1px 1px #ccc;
+ -moz-box-shadow: 0 1px 1px #ccc;
+ -webkit-box-shadow: 0 1px 1px #ccc;
+}
+#nav-main li:first-child {
+ -moz-border-top-left-radius: 4px;
+ border-top-left-radius: 4px;
+ -moz-border-bottom-left-radius: 4px;
+ border-bottom-left-radius: 4px;
+}
+#nav-main li:last-child {
+ -moz-border-top-right-radius: 4px;
+ border-top-right-radius: 4px;
+ -moz-border-bottom-right-radius: 4px;
+ border-bottom-right-radius: 4px;
+}
+#nav-main .quickref {
+ color: #444;
+}
+#nav-main .quickref .sep {
+ color: #999;
+}
+#search {
+ width: 120px;
+ margin-left: 0.5em;
+}
+#search.inactive {
+ text-align: center;
+ color: #444;
+}
+
+/* Footer */
+#site-info {
+ position: relative;
+ text-align: center;
+}
+#site-info, #site-info a:link, #site-info a:visited {
+ color: #aaa;
+}
+
+/* Content */
+#content {
+ clear: both;
+ padding: 0;
+ position: relative;
+ margin-top: 1.5em;
+ margin-bottom: 1.5em;
+ border-top: solid 1px #aaa;
+ border-bottom: solid 1px #aaa;
+}
+.left-column {
+ width: 49%;
+ float: left;
+}
+.right-column {
+ width: 49%;
+ float: right;
+}
+.end-columns {
+ clear: both;
+}
+#content h1 {
+ padding: 0;
+}
+#content h2 {
+ border-top: 2px solid #ddd;
+ padding: 8px 0;
+ margin: 1.5em 0 0;
+}
+#content .subtitle {
+ margin-top: 1em;
+ display: block;
+}
+.navtop a {
+ font-weight: normal; font-size: 7pt;
+ float: right; color: #999;
+}
+
+/* Content and Code Highlighting */
+pre.ebnf, pre.grammar {
+ background: #FFFFE0;
+}
+span.ln {
+ font-size: 80%;
+ color: #777777;
+}
+span.comment {
+ color: #002090;
+}
+span.highlight {
+ background: #FF9900;
+ font-weight: bold;
+}
+span.highlight-comment {
+ background: #FF9900;
+ font-weight: bold;
+ color: #002090;
+}
+span.selection {
+ background: #FFFF00
+}
+span.selection-comment {
+ color: #002090;
+ background: #FFFF00
+}
+span.selection-highlight {
+ background: #FF9900;
+ font-weight: bold;
+}
+span.selection-highlight-comment {
+ background: #FF9900;
+ font-weight: bold;
+ color: #002090;
+}
+span.alert {
+ color: #D00000;
+}
+#nav table {
+ width: 100%;
+}
+.detail {
+ padding: 0.25em 1em;
+ background: #F4F4F4;
+}
+sup.new {
+ color: red;
+ font-size: 8px;
+ line-height: 0;
+}
190 godocs.js
@@ -0,0 +1,190 @@
+// Except as noted, this content is licensed under Creative Commons
+// Attribution 3.0
+
+/* A little code to ease navigation of these documents.
+ *
+ * On window load we:
+ * + Generate a table of contents (godocs_generateTOC)
+ * + Add links up to the top of the doc from each section (godocs_addTopLinks)
+ */
+
+/* We want to do some stuff on page load (after the HTML is rendered).
+ So listen for that:
+ */
+function bindEvent(el, e, fn) {
+ if (el.addEventListener){
+ el.addEventListener(e, fn, false);
+ } else if (el.attachEvent){
+ el.attachEvent('on'+e, fn);
+ }
+}
+bindEvent(window, 'load', godocs_onload);
+
+function godocs_onload() {
+ godocs_bindSearchEvents();
+ godocs_generateTOC();
+ godocs_addTopLinks();
+}
+
+function godocs_bindSearchEvents() {
+ var search = document.getElementById('search');
+ if (!search) {
+ // no search box (index disabled)
+ return;
+ }
+ function clearInactive() {
+ if (search.className == "inactive") {
+ search.value = "";
+ search.className = "";
+ }
+ }
+ function restoreInactive() {
+ if (search.value != "") {
+ return;
+ }
+ if (search.type != "search") {
+ search.value = search.getAttribute("placeholder");
+ }
+ search.className = "inactive";
+ }
+ restoreInactive();
+ bindEvent(search, 'focus', clearInactive);
+ bindEvent(search, 'blur', restoreInactive);
+}
+
+/* Generates a table of contents: looks for h2 and h3 elements and generates
+ * links. "Decorates" the element with id=="nav" with this table of contents.
+ */
+function godocs_generateTOC() {
+ var navbar = document.getElementById('nav');
+ if (!navbar) { return; }
+
+ var toc_items = [];
+
+ var i;
+ for (i = 0; i < navbar.parentNode.childNodes.length; i++) {
+ var node = navbar.parentNode.childNodes[i];
+ if ((node.tagName == 'h2') || (node.tagName == 'H2')) {
+ if (!node.id) {
+ node.id = 'tmp_' + i;
+ }
+ var text = godocs_nodeToText(node);
+ if (!text) { continue; }
+
+ var textNode = document.createTextNode(text);
+
+ var link = document.createElement('a');
+ link.href = '#' + node.id;
+ link.appendChild(textNode);
+
+ // Then create the item itself
+ var item = document.createElement('dt');
+
+ item.appendChild(link);
+ toc_items.push(item);
+ }
+ if ((node.tagName == 'h3') || (node.tagName == 'H3')) {
+ if (!node.id) {
+ node.id = 'tmp_' + i;
+ }
+ var text = godocs_nodeToText(node);
+ if (!text) { continue; }
+
+ var textNode = document.createTextNode(text);
+
+ var link = document.createElement('a');
+ link.href = '#' + node.id;
+ link.appendChild(textNode);
+
+ // Then create the item itself
+ var item = document.createElement('dd');
+
+ item.appendChild(link);
+ toc_items.push(item);
+ }
+ }
+
+ if (toc_items.length <= 1) { return; }
+
+ var dl1 = document.createElement('dl');
+ var dl2 = document.createElement('dl');
+
+ var split_index = (toc_items.length / 2) + 1;
+ if (split_index < 8) {
+ split_index = toc_items.length;
+ }
+
+ for (i = 0; i < split_index; i++) {
+ dl1.appendChild(toc_items[i]);
+ }
+ for (/* keep using i */; i < toc_items.length; i++) {
+ dl2.appendChild(toc_items[i]);
+ }
+
+ var tocTable = document.createElement('table');
+ navbar.appendChild(tocTable);
+ tocTable.className = 'unruled';
+ var tocBody = document.createElement('tbody');
+ tocTable.appendChild(tocBody);
+
+ var tocRow = document.createElement('tr');
+ tocBody.appendChild(tocRow);
+
+ // 1st column
+ var tocCell = document.createElement('td');
+ tocCell.className = 'first';
+ tocRow.appendChild(tocCell);
+ tocCell.appendChild(dl1);
+
+ // 2nd column
+ tocCell = document.createElement('td');
+ tocRow.appendChild(tocCell);
+ tocCell.appendChild(dl2);
+}
+
+/* Returns the "This sweet header" from <h2>This <i>sweet</i> header</h2>.
+ * Takes a node, returns a string.
+ */
+function godocs_nodeToText(node) {
+ var TEXT_NODE = 3; // Defined in Mozilla but not MSIE :(
+
+ var text = '';
+ for (var j = 0; j != node.childNodes.length; j++) {
+ var child = node.childNodes[j];
+ if (child.nodeType == TEXT_NODE) {
+ if (child.nodeValue != '[Top]') { //ok, that's a hack, but it works.
+ text = text + child.nodeValue;
+ }
+ } else {
+ text = text + godocs_nodeToText(child);
+ }
+ }
+ return text;
+}
+
+/* For each H2 heading, add a link up to the #top of the document.
+ * (As part of this: ensure existence of 'top' named anchor link
+ * (theoretically at doc's top).)
+ */
+function godocs_addTopLinks() {
+ /* Make sure there's a "top" to link to. */
+ var top = document.getElementById('top');
+ if (!top) {
+ document.body.id = 'top';
+ }
+
+ if (!document.getElementsByTagName) return; // no browser support
+
+ var headers = document.getElementsByTagName('h2');
+
+ for (var i = 0; i < headers.length; i++) {
+ var span = document.createElement('span');
+ span.className = 'navtop';
+ var link = document.createElement('a');
+ span.appendChild(link);
+ link.href = '#top';
+ var textNode = document.createTextNode('[Top]');
+ link.appendChild(textNode);
+ headers[i].appendChild(span);
+ }
+}
177 index.html
@@ -0,0 +1,177 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>Package ironmq - The Go Programming Language</title>
+
+<link rel="stylesheet" href="all.css" type="text/css" media="all" charset="utf-8">
+<!--[if lt IE 8]>
+<link rel="stylesheet" href="/doc/ie.css" type="text/css">
+<![endif]-->
+<script type="text/javascript" src="godocs.js"></script>
+</head>
+<body>
+<div id="container">
+ <div id="topnav">
+ <h1 id="title">The Go Programming Language</h1>
+ </div>
+ <div id="content">
+ <!-- Menu is HTML-escaped elsewhere -->
+
+
+
+ <h1 id="generatedHeader">Package ironmq</h1>
+
+
+
+ <!-- The Table of Contents is automatically inserted in this <div>.
+ Do not delete this <div>. -->
+ <div id="nav"></div>
+
+ <!-- Content is HTML-escaped elsewhere -->
+ <!--
+ 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.
+-->
+
+
+ <!-- PackageName is printed as title by the top-level template -->
+
+ <p><code>import "ironmq_go"</code></p>
+
+
+
+
+ <p>
+ <h4>Package files</h4>
+ <span style="font-size:90%">
+
+ <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go">ironmq.go</a>
+
+ </span>
+ </p>
+
+
+
+
+
+
+
+
+ <h2 id="Client">type <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L3">Client</a></h2>
+ <p>
+A Client contains an Iron.io project ID and a token for authentication.
+</p>
+
+ <p><pre>type Client struct {
+ <span class="comment">// contains filtered or unexported fields</span>
+}</pre></p>
+
+
+
+
+ <h3 id="Client.NewClient">func <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L10">NewClient</a></h3>
+ <p><code>func NewClient(projectId, token string) *Client</code></p>
+ <p>
+NewClient returns a new Client using the given project ID and token.
+The network is not used during this call.
+</p>
+
+
+
+
+ <h3 id="Client.Queue">func (*Client) <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L64">Queue</a></h3>
+ <p><code>func (c *Client) Queue(name string) *Queue</code></p>
+ <p>
+Queue returns a Queue using the given name.
+The network is not used during this call.
+</p>
+
+
+
+
+ <h2 id="Error">type <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L14">Error</a></h2>
+
+ <p><pre>type Error struct {
+ Status int
+ Msg string
+}</pre></p>
+
+
+
+
+
+ <h3 id="Error.String">func (*Error) <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L19">String</a></h3>
+ <p><code>func (e *Error) String() string</code></p>
+
+
+
+
+ <h2 id="Message">type <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L108">Message</a></h2>
+
+ <p><pre>type Message struct {
+ Id string `json:&#34;id,omitempty&#34;`
+ Body string `json:&#34;body&#34;`
+ <span class="comment">// Timeout is the amount of time allowed for processing a message.</span>
+ Timeout int64 `json:&#34;timeout,omitempty&#34;`
+ <span class="comment">// contains filtered or unexported fields</span>
+}</pre></p>
+
+
+
+
+
+ <h3 id="Message.Delete">func (*Message) <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L116">Delete</a></h3>
+ <p><code>func (m *Message) Delete() os.Error</code></p>
+
+
+
+
+ <h2 id="Queue">type <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L57">Queue</a></h2>
+ <p>
+Queue represents an IronMQ queue.
+</p>
+
+ <p><pre>type Queue struct {
+ <span class="comment">// contains filtered or unexported fields</span>
+}</pre></p>
+
+
+
+
+
+ <h3 id="Queue.Get">func (*Queue) <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L70">Get</a></h3>
+ <p><code>func (q *Queue) Get() (*Message, os.Error)</code></p>
+ <p>
+Get takes one Message off of the queue. The Message will be returned to the queue
+if not deleted before the item&#39;s timeout.
+</p>
+
+
+
+ <h3 id="Queue.Push">func (*Queue) <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L100">Push</a></h3>
+ <p><code>func (q *Queue) Push(msg string) os.Error</code></p>
+ <p>
+Push adds a message to the queue using IronMQ&#39;s default timeout of 10 minutes.
+</p>
+
+
+
+ <h3 id="Queue.PushTimeout">func (*Queue) <a href="https://github.com/iron-io/ironmq_go/blob/master/ironmq.go#L104">PushTimeout</a></h3>
+ <p><code>func (q *Queue) PushTimeout(msg string, timeout int64) os.Error</code></p>
+
+
+
+
+
+
+
+ </div>
+ <div id="site-info">
+ <p>Build version release.r60.3 10073+. Except as noted, this content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 License</a>.</p>
+ </div>
+</div>
+</body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.