jira

package
v0.0.0-...-e526b14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2025 License: ISC Imports: 14 Imported by: 0

Documentation

Overview

Jira is a program to interact with Jira issues from the Acme editor. Projects, issues and comments are presented as a virtual read-only filesystem (using package io/fs) which can be browsed in the usual way Acme handles filesystems served by the host system.

The filesystem root holds project directories. Within each project are the project's issues, one directory entry per issue. The filepaths for issues TEST-1, TEST-2, and WEB-27 would be:

TEST/1
TEST/2
WEB/27

Each issue directory has a file named "issue" holding a textual representation of the issue and a listing of comments. For example, TEST/1/issue.

Comments are available as numbered files alongside the issue file. Comment 69 of issue TEST-420 can be accessed at TEST/420/69.

https:developer.atlassian.com/cloud/jira/platform/rest/v2/ https:jira.atlassian.com/rest/api/2/issue/JRA-9

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateComment

func CreateComment(APIRoot, issueKey string, body io.Reader) error

Types

type Client

type Client struct {
	*http.Client
	Debug              bool
	Username, Password string
	APIRoot            *url.URL
}

func (*Client) CheckIssue

func (c *Client) CheckIssue(name string) (bool, error)

func (*Client) Comment

func (c *Client) Comment(ikey, id string) (*Comment, error)

func (*Client) Issue

func (c *Client) Issue(name string) (*Issue, error)

func (*Client) Issues

func (c *Client) Issues(project string) ([]Issue, error)

func (*Client) PostComment

func (c *Client) PostComment(issueKey string, body io.Reader) error

func (*Client) Project

func (c *Client) Project(name string) (*Project, error)

func (*Client) Projects

func (c *Client) Projects() ([]Project, error)

func (*Client) SearchIssues

func (c *Client) SearchIssues(query string) ([]Issue, error)

type Comment

type Comment struct {
	ID           string    `json:"id"` // TODO(otl): int?
	URL          string    `json:"self"`
	Body         string    `json:"body"`
	Created      time.Time `json:"created"`
	Updated      time.Time `json:"updated"`
	Author       User      `json:"author"`
	UpdateAuthor User      `json:"updateAuthor"`
}

func (*Comment) IsDir

func (c *Comment) IsDir() bool

func (*Comment) ModTime

func (c *Comment) ModTime() time.Time

func (*Comment) Mode

func (c *Comment) Mode() fs.FileMode

func (*Comment) Name

func (c *Comment) Name() string

func (*Comment) Size

func (c *Comment) Size() int64

func (*Comment) Sys

func (c *Comment) Sys() any

func (*Comment) UnmarshalJSON

func (c *Comment) UnmarshalJSON(b []byte) error

type FS

type FS struct {
	Client *Client
	// contains filtered or unexported fields
}

func (*FS) Open

func (fsys *FS) Open(name string) (fs.File, error)

type Issue

type Issue struct {
	ID       string // TODO(otl): int?
	URL      string
	Key      string
	Reporter User
	Assignee User
	Summary  string
	Status   struct {
		Name string `json:"name"`
	} `json:"status"`
	Description string
	Project     Project
	Created     time.Time
	Updated     time.Time
	Comments    []Comment
	Links       []Issue
	Subtasks    []Issue
}

func Create

func Create(APIRoot string, issue Issue) (*Issue, error)

func (*Issue) IsDir

func (is *Issue) IsDir() bool

func (*Issue) ModTime

func (is *Issue) ModTime() time.Time

func (*Issue) Mode

func (is *Issue) Mode() fs.FileMode

func (*Issue) Name

func (is *Issue) Name() string

func (*Issue) Size

func (is *Issue) Size() int64

func (*Issue) Sys

func (is *Issue) Sys() any

func (*Issue) UnmarshalJSON

func (issue *Issue) UnmarshalJSON(b []byte) error

type Project

type Project struct {
	ID string `json:"id"` // TODO(otl): int?
	// Name string `json:"name"`
	Key string `json:"key"`
	URL string `json:"self"`
}

func (*Project) IsDir

func (p *Project) IsDir() bool

func (*Project) ModTime

func (p *Project) ModTime() time.Time

func (*Project) Mode

func (p *Project) Mode() fs.FileMode

func (*Project) Name

func (p *Project) Name() string

func (*Project) Size

func (p *Project) Size() int64

func (*Project) Sys

func (p *Project) Sys() any

type User

type User struct {
	Name        string `json:"name"`
	Email       string `json:"emailAddress"`
	DisplayName string `json:"displayName"`
}

func (User) String

func (u User) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL