kanban

package module
v0.0.0-...-ad861b7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT, Unlicense Imports: 3 Imported by: 0

README

Kanban

Kanban app in (pure) Go using the Gio toolkit.

This application implements a simple Kanban workflow. It represents a small vertical slice of what a desktop app might look like with Gio, in both structure and aesthetic.

The codebase is prototypical and contains some experiments that may fall outside Gio idioms. In that light, this could make a great place for discovering patterns that work well with Gio for the desktop environment.

  • Data is stored in a Bolt database on disk.
  • GUI is rendered via Gio.

Feedback welcome!

go get -u git.sr.ht/~jackmordaunt/kanban/... && kanban

main-view edit-view

Documentation

Overview

Package kanban implements Kanban logic.

Kanban is Project oriented, where a Project holds the context for given set of Stages and Tickets.

Projects are independent of each other.

Notes:

Project - represents some project that can be broken down into to discrete tasks, described by a name - each project has it's own arbitrary pipeline of stages with which tickets move through left-to-right - contains an ordered list of stages - stages are re-orderable - can be renamed - can be deleted

Stage - represents an important part in the lifecycle of a task, described by a name - contains an ordered list of tickets - tickets are re-orderable - tickets can advance back and forth between stages, typically linearly - can be renamed - can be deleted

Ticket - contains information about a task for a project - is unique to a Project and sits within one of it's stages - cannot occupy more than one stage - can be edited - can be deleted

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction int8

Direction encodes mutually exclusive directions.

const (
	Forward Direction = iota
	Backward
)

func (Direction) Invert

func (dir Direction) Invert() Direction

Invert returns the inverse of dir.

func (Direction) Next

func (dir Direction) Next() int

Next returns the direction as a signed integer, where positive is forward.

type Project

type Project struct {
	ID uuid.UUID
	// Name of the project.
	Name string
	// Stages is the list of stages owned by the project.
	Stages Stages
	// Finalized is a psuedo stage that contains all finalized tickets.
	Finalized []Ticket
}

Project is a context for a given set of tickets.

func (*Project) AssignTicket

func (p *Project) AssignTicket(stage string, ticket Ticket) error

AssignTicket assigns a ticket to the given stage.

func (Project) Clone

func (p Project) Clone() Project

Clone a project ensuring all data is copied.

func (*Project) Eq

func (p *Project) Eq(other *Project) bool

func (*Project) FinalizeTicket

func (p *Project) FinalizeTicket(t Ticket)

FinalizeTicket renders the ticket "complete" and moves it into an archive.

func (*Project) ListStages

func (p *Project) ListStages() []Stage

func (*Project) ListTickets

func (p *Project) ListTickets(stage string) []Ticket

func (*Project) MakeStage

func (p *Project) MakeStage(name string)

MakeStage assigns a ticket to the given stage.

func (*Project) MoveStage

func (p *Project) MoveStage(name string, dir Direction) bool

func (*Project) MoveTicket

func (p *Project) MoveTicket(ticket Ticket, dir Direction) bool

MoveTicket within a stage.

func (*Project) ProgressTicket

func (p *Project) ProgressTicket(ticket Ticket)

ProgressTicket moves a ticket to the "next" stage.

func (*Project) RegressTicket

func (p *Project) RegressTicket(ticket Ticket)

RegressTicket moves a ticket to the "previous" stage.

func (*Project) StageForTicket

func (p *Project) StageForTicket(ticket Ticket) *Stage

StageForTicket returns the stage containing the specified ticket.

func (*Project) String

func (p *Project) String() string

func (*Project) UpdateTicket

func (p *Project) UpdateTicket(ticket Ticket) error

Update an existing ticket. It is an error to attempt to update a ticket that does not exist.

type Stage

type Stage struct {
	Name    string
	Tickets []Ticket
}

Stage in the kanban pipeline, can hold a number of tickets.

func (*Stage) Assign

func (s *Stage) Assign(ticket Ticket) error

Assign appends a ticket to the stage with a unique ID. Existing tickets will be duplicated, but with different IDs.

func (*Stage) Contains

func (s *Stage) Contains(ticket Ticket) bool

Contains returns true if the specified ticket exists in the stage.

func (Stage) Eq

func (s Stage) Eq(other Stage) bool

func (*Stage) Take

func (s *Stage) Take(ticket Ticket) Ticket

Take the specified ticket, if it exists. Removes it from the stage.

func (*Stage) UnAssign

func (s *Stage) UnAssign(ticket Ticket)

UnAssign removes a ticket from the stage.

func (*Stage) Update

func (s *Stage) Update(ticket Ticket) bool

Update a ticket, returning a bool to indicate success. False means ticket does not exist and therefore nothing was updated.

type Stages

type Stages []Stage

Stages is a list of Stage.

func (Stages) Eq

func (s Stages) Eq(other Stages) bool

func (*Stages) Find

func (stages *Stages) Find(name string) *Stage

Find stage by name.

func (*Stages) Index

func (stages *Stages) Index(name string) (int, bool)

Index returns the index postition for the stage, false if no stage exists.

func (*Stages) Swap

func (stages *Stages) Swap(stage string, dir Direction) bool

Swap the specified stage in the given direction. Returns false when at a boundary, and therefore no swap can occur.

type Ticket

type Ticket struct {
	ID uuid.UUID
	// Title of the ticket.
	Title string
	// Summary contains short and concise overview of the ticket.
	Summary string
	// Details contains the full details of the ticket.
	Details string
	// Created when the ticket was created.
	Created time.Time
}

Ticket in a stage.

Directories

Path Synopsis
cmd
Package storage specifies a storage interface for Kanban Projects.
Package storage specifies a storage interface for Kanban Projects.
lazy
Package lazy implements a lazy storage that only touches the disk when necessary.
Package lazy implements a lazy storage that only touches the disk when necessary.
mem

Jump to

Keyboard shortcuts

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