shithub: jirafs

Download patch

ref: e8f68c855c36b47a2fc2f6357988d12ba4db0371
parent: 206b62634c0dd5da2745f9d3afe253e022a7e007
author: Romano <dromano@intellisurvey.com>
date: Tue Feb 12 20:06:07 EST 2019

gofmt and update README

--- a/README.md
+++ b/README.md
@@ -29,12 +29,14 @@
 
 These issues are due to v9fs not getting much use as a "normal" 9P client, but let's change that!
 
-On MacOSX, you can use plan9port and 9pfuse. First install [FUSE for macOS](https://osxfuse.github.io/). Then install [plan9port](https://9fans.github.io/plan9port/). You can then use 9pfuse to mount. Beware, however, that stock 'ls' on MacOSX won't work to show the available directory files--you have to use '9 ls', '9 lc' etc.
+On MacOSX, there are two options:
+* You can use plan9port which provides 9pfuse. First install [FUSE for macOS](https://osxfuse.github.io/). Then install [plan9port](https://9fans.github.io/plan9port/). You can then use 9pfuse to mount. Beware, however, that stock 'ls' on MacOSX won't work to show the available directory files--you have to use '9 ls', '9 lc' etc.
 ```plain
 cd jirafs; go build; ./jirafs -pass -url=https://jira.example.com
 # then after entering credentials, open another terminal in the parent directory you want for accessing JIRA:
 9pfuse 'tcp!localhost!30000' my-jira; cd my-jira; 9 lc projects
 ```
+* You can use [Mac9P](https://github.com/kennylevinsen/mac9p). Follow the install instructions.
 
 ## Disclaimer
 
--- a/client.go
+++ b/client.go
@@ -7,8 +7,8 @@
 	"encoding/json"
 	"encoding/pem"
 	"fmt"
-    "io"
-    "io/ioutil"
+	"io"
+	"io/ioutil"
 	"net/http"
 	"net/url"
 
@@ -18,8 +18,8 @@
 type Client struct {
 	*http.Client
 
-	user, pass              string
-	jiraURL                 *url.URL
+	user, pass string
+	jiraURL    *url.URL
 	usingOAuth bool
 
 	maxlisting int
@@ -41,7 +41,7 @@
 		return err
 	}
 
-    var b io.Reader
+	var b io.Reader
 	switch x := body.(type) {
 	case nil:
 	case []byte:
@@ -65,7 +65,7 @@
 	req.Header.Set("X-Atlassian-Token", "nocheck")
 
 	if !c.usingOAuth {
-		req.SetBasicAuth(c.user, c.pass);
+		req.SetBasicAuth(c.user, c.pass)
 	}
 
 	resp, err := c.Client.Do(req)
--- a/jira.go
+++ b/jira.go
@@ -205,7 +205,7 @@
 
 	issueLock sync.Mutex
 	newIssue  bool
-	values	map[string]string
+	values    map[string]string
 }
 
 func (iw *IssueView) normalFiles() (files, dirs []string) {
@@ -259,7 +259,7 @@
 						Project: jira.Project{
 							Key: project,
 						},
-						Summary:	 summary,
+						Summary:     summary,
 						Description: description,
 					},
 				}
@@ -624,9 +624,9 @@
 }
 
 type SearchView struct {
-	query	  string
+	query      string
 	resultLock sync.Mutex
-	results	[]string
+	results    []string
 }
 
 func (sw *SearchView) search(jc *Client) error {
@@ -836,7 +836,7 @@
 		sf.SetContent([]byte(message))
 		return sf, nil
 	} else if issueKey == "structure" {
-        message :=`new/
+		message := `new/
 	 ctl
 	 description
 	 project
@@ -918,15 +918,15 @@
 		return nil, err
 	}
 
-	keys	= append(keys, "new")
+	keys = append(keys, "new")
 	issues := StringsToStats(keys, 0555|qp.DMDIR, "jira", "jira")
-	help	:= StringsToStats([]string{"help","structure"}, 055, "jira", "jira")
+	help := StringsToStats([]string{"help", "structure"}, 055, "jira", "jira")
 	return append(issues, help...), nil
 }
 
 type JiraView struct {
 	searchLock sync.Mutex
-	searches	map[string]*SearchView
+	searches   map[string]*SearchView
 }
 
 func (jw *JiraView) Walk(jc *Client, file string) (trees.File, error) {
@@ -984,7 +984,7 @@
 	case "issues":
 		return NewJiraDir(file, 0555|qp.DMDIR, "jira", "jira", jc, &AllIssuesView{})
 	case "structure":
-message := `
+		message := `
 /
 	ctl
 	projects/
--- a/main.go
+++ b/main.go
@@ -13,13 +13,13 @@
 )
 
 var (
-	address     = flag.String("address", "localhost:30000", "address to bind on")
-	usingOAuth  = flag.Bool("oauth", false, "use OAuth 1.0 for authorization")
-	ckey        = flag.String("ckey", "", "consumer key for OAuth")
-	pkey        = flag.String("pkey", "", "private key file for OAuth")
-	pass        = flag.Bool("pass", false, "use password for authorization")
-	jiraURLStr  = flag.String("url", "", "jira URL")
-	maxlisting  = flag.Int("maxlisting", 100, "max directory listing length")
+	address    = flag.String("address", "localhost:30000", "address to bind on")
+	usingOAuth = flag.Bool("oauth", false, "use OAuth 1.0 for authorization")
+	ckey       = flag.String("ckey", "", "consumer key for OAuth")
+	pkey       = flag.String("pkey", "", "private key file for OAuth")
+	pass       = flag.Bool("pass", false, "use password for authorization")
+	jiraURLStr = flag.String("url", "", "jira URL")
+	maxlisting = flag.Int("maxlisting", 100, "max directory listing length")
 )
 
 func main() {
@@ -32,10 +32,10 @@
 	}
 
 	client := &Client{
-		Client:      &http.Client{},
-		usingOAuth:  *usingOAuth,
-		jiraURL:     jiraURL,
-		maxlisting:  *maxlisting,
+		Client:     &http.Client{},
+		usingOAuth: *usingOAuth,
+		jiraURL:    jiraURL,
+		maxlisting: *maxlisting,
 	}
 
 	switch {