lit

package module
v0.0.0-...-2ee800c Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2016 License: MIT Imports: 14 Imported by: 0

README

lit

Lit is a lightweight issue tracker.

To install lit, install Go if it isn't already, and run:

go get github.com/ianremmler/lit/cmd/lit

Run lit help to see how to use it.

Currently, the only configuration available is the environment variable LIT_USER which, if set, will be used instead of the current username.

Issues are stored in a single text file in Doggerel format.

Some scripts are included to enable complex queries from the command line. Using shell command substitution, the syntax looks a bit like Lisp. For example, to list the issues that are open and either assigned to user bob or have priority greater than 1:

# Note: 'lit id' returns ids of open issues
lit list $(andl $(lit id) \
                $(orl $(lit with assigned bob) \
                      $(lit greater priority 1)))

Documentation

Overview

Package lit provides the core of the lightweight issue tracker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(issue *dgrl.Branch, key string) (string, bool)

Get returns the value for the given key, if found in the issue. key may be a substring matching the beginning of the issue key.

func ModifyTag

func ModifyTag(issue *dgrl.Branch, tag string, doAdd bool) bool

ModifyTag adds or removes a tag for a given issue

func Set

func Set(issue *dgrl.Branch, key, val string) bool

Set sets the value for the given key, if found in the issue. key may be a substring matching the beginning of the issue key.

func Stamp

func Stamp(username string) string

Stamp returns a string consisting of the current time in RFC3339 UTC format and the username, separated by a space.

Types

type Lit

type Lit struct {
	// contains filtered or unexported fields
}

Lit stores and manipulates issues

func New

func New() *Lit

New constructs a new Lit.

func (*Lit) Attach

func (l *Lit) Attach(issue *dgrl.Branch, src, username, comment string) (string, error)

Attach attaches a file to an issue

func (*Lit) Attachments

func (l *Lit) Attachments(issue *dgrl.Branch) []string

Attachments returns a list of an issue's attachments

func (*Lit) Compare

func (l *Lit) Compare(key, val string, isLess bool) []string

Compare returns a list of ids for all issues whose value for key is less or greater, determined by isLess, than val.

func (*Lit) GetAttachment

func (l *Lit) GetAttachment(issue *dgrl.Branch, filename string) (*os.File, error)

GetAttachment returns a file attached to an issue

func (*Lit) Init

func (l *Lit) Init() error

Init initializes the issue tracker.

func (*Lit) Issue

func (l *Lit) Issue(id string) *dgrl.Branch

Issue returns an issue for the given id

func (*Lit) IssueDir

func (l *Lit) IssueDir(issue *dgrl.Branch) string

IssueDir returns the directory name that corresponds to an issue

func (*Lit) IssueIds

func (l *Lit) IssueIds() []string

IssueIds returns a slice of all issue ids

func (*Lit) Load

func (l *Lit) Load() error

Load parses the issue file and populates the list of issues

func (*Lit) Match

func (l *Lit) Match(key, val string, doesMatch bool) []string

Match returns a list of ids for all issues whose value for key contains val.

func (*Lit) NewIssues

func (l *Lit) NewIssues(username string, num int) []*dgrl.Branch

NewIssues adds and returns pointers to new issues

func (*Lit) Sort

func (l *Lit) Sort(ids []string, key string, doAscend bool)

Sort sorts the list of ids by the value for the given key.

func (*Lit) Store

func (l *Lit) Store() error

Store writes the issue list to the file

Directories

Path Synopsis
cmd
lit

Jump to

Keyboard shortcuts

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