trackello

package module
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

README

trackello

Go Report Card codecov wercker status

Tracking your work in Trello from the command-line

Setup

Pre-configured Go environment

If you are proficient in developing and building Go applications, you can simply install with the following command:

go get github.com/klauern/trackello/cmd/trackello

Make file

An alternative setup is to use the Makefile:

make setup
make
make trackello
./bin/trackello # For running

Motivation

There's a decent set of blog posts that I have been working on to explain the rationale:

Future work

  • Display Key identifying summary fields
  • Add color-coding for labels
  • lots more tests
  • create helper to configure the Trello API/Token/Board settings on first run

Documentation

Index

Constants

View Source
const (
	// TRACKELLO_APPKEY represents the underlying environment variable for Trello's AppKey
	TRACKELLO_APPKEY = "TRACKELLO_TRELLO_APPKEY"
	// TRACKELLO_TOKEN represents the underlying environment variables for the Trello Token
	TRACKELLO_TOKEN = "TRACKELLO_TRELLO_TOKEN"
	// TRACKELLO_PREFERRED_BOARD represents the underlying environment variable for the preferred Board ID to retrieve
	TRACKELLO_PREFERRED_BOARD = "TRACKELLO_TRELLO_PREFERREDBOARD"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

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

Board is a super-type for a Trello board. Board also contains a mutex and map of a List ID to a List.

func NewBoard

func NewBoard(b *trello.Board) *Board

NewBoard will create a new Board type, using a trello.Board as a starting point.

func (*Board) MapActions

func (b *Board) MapActions() error

MapActions queries Trello's API for all of the recent actions performed on a Board, and maps that to the board itself, into a list and card.

func (*Board) PopulateLists

func (b *Board) PopulateLists() error

PopulateLists will Populate the board's lists with cards and missing data.

func (*Board) PrintActions

func (b *Board) PrintActions() string

PrintActions will print the board actions out.

type ByListName

type ByListName []List

ByListName is a sortable type for []List, allowing sorting by the List Name (case-insensitive).

func (ByListName) Len

func (l ByListName) Len() int

Len returns the length of the ByListName slice.

func (ByListName) Less

func (l ByListName) Less(i, j int) bool

Less determines which of the two trackello.List items is before other based on the List Name (lowercased).

func (ByListName) Swap

func (l ByListName) Swap(i, j int)

Swap will swap the positions of two trackello.List items in the ByListName slice.

type ByStatisticsCountRev

type ByStatisticsCountRev []Card

ByStatisticsCountRev is a sortable type for the Card slice, sorting by the number of actions performed in descending order.

func (ByStatisticsCountRev) Len

func (c ByStatisticsCountRev) Len() int

Len returns the length of the underlying []Card slice.

func (ByStatisticsCountRev) Less

func (c ByStatisticsCountRev) Less(i, j int) bool

Less returns whether the [i] position has MORE actions on it's underlying Card than the [j] element.

func (ByStatisticsCountRev) Swap

func (c ByStatisticsCountRev) Swap(i, j int)

Swap swaps the positions of two Card items in the underlying []Card slice.

type Card

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

Card is both the Trello Card + other stats on the actions in it.

func NewCard

func NewCard(c trello.Card) Card

NewCard will construct a new Card element using a trello.Card as a base type.

func (*Card) AddCalculation

func (c *Card) AddCalculation(a trello.Action) error

AddCalculation will the new action to the Card's statistics.

func (*Card) String

func (c *Card) String() string

type List

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

List is both the Trello List + other stats on the actions in it.

func NewList

func NewList(l *trello.List) *List

NewList constructs a new *List based off of a go-trello *List.

func (*List) MapActions

func (l *List) MapActions() error

MapActions will map all of the Actions that occurred on a List.

func (*List) MapCards

func (l *List) MapCards() error

MapCards maps all of the cards for a list into the List.cards map[string]Card based on the cardID.

func (*List) PrintNonZeroActions

func (l *List) PrintNonZeroActions() string

PrintNonZeroActions will print out a list and all of the cards to the command-line that have more than 0 actions associated with them.

type Statistics

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

Statistics provides a way to show statistical information about a list, card or whatnot by aggregating the updates, comments, checklists, and other actions under a specific item.

func (*Statistics) PrintStatistics

func (s *Statistics) PrintStatistics() string

PrintStatistics will print the statistics information out. Example format: [ 3 + 2 ≡ 0 ✓ 1 … ]

func (*Statistics) Total

func (s *Statistics) Total() int

Total will print out the total number of actions that accumulate to make up the statistics information for a Card.

type Trackello

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

Trackello represents the connection to Trello for a specific user.

func NewTrackello

func NewTrackello(token, appKey string) (*Trackello, error)

NewTrackello will create a Trackello type using your preferences application token and appkey.

func (*Trackello) Board

func (t *Trackello) Board(id string) (*trello.Board, error)

Board will return the Trello Board given it's ID string.

func (*Trackello) Boards

func (t *Trackello) Boards() ([]trello.Board, error)

Boards will list all of the boards for the authenticated user (i.e. 'me').

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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