okr2go

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

README

okr2go

Actions Status Go Reference GitHub Rlease License

okr2go (as in to go) is a simple tracker for your Objective and Key Results (OKR) that you can use locally just using a Markdown file and thus is available to go.

Ideally, this Markdown file is stored in a git repository, if you want to synchronize it with others. It also includes a simple React-based web frontend to view (and in the future, edit) your objectives.

Use a Release

Fetch a binary from the latest GitHub release corresponding to your system architecture and start it using ./okr2go. A browser window with the web ui should open automatically.

Alternativly, a prepared Docker image can be used. In this case the markdown file needs to be mounted into the container.

docker run -v $(PWD)/example.md:/example.md -p 4300:4300 ghcr.io/oxisto/okr2go

Build from Source

okr2go requires Go >= 1.16 and yarn installed.

Install Go

On Linux, follow the instructions at https://golang.org/doc/install or an instruction related to your distribution.

On macOS, use brew to install Go:

brew install go
Install yarn

On Debian/Ubuntu, the latest yarn version can be installed from the following ppa:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn

On macOS, use brew to install yarn:

brew install yarn
Run build script

Run the included build script to install all dependencies (React and Go) and build an executable with the packed web frontend. This will also run go install, so that your system-specific executable is available globally, if you have the go/bin directory in your path.

./build.sh

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureLogging

func ConfigureLogging() *logrus.Logger

func Dump

func Dump(node *blackfriday.Node, entering bool) blackfriday.WalkStatus

func GetObjectives

func GetObjectives(w http.ResponseWriter, r *http.Request)

func JSONResponse added in v0.5.0

func JSONResponse(w http.ResponseWriter, r *http.Request, object interface{}, err error)

JSONResponse returns a JSON encoded object with http.StatusOK, if error is nil. Otherwise the error is returned and status code is set to http.StatusInternalServerError

func JSONResponseWithStatus added in v0.5.0

func JSONResponseWithStatus(w http.ResponseWriter, r *http.Request, object interface{}, err error, statusCode int)

JSONResponseWithStatus returns a JSON encoded object with statusCode, if error is nil. Otherwise the error is returned and status code is set to http.StatusInternalServerError

func LoadObjectives

func LoadObjectives() (err error)

func NewRouter

func NewRouter() *mux.Router

NewRouter returns a configured mux router containing all REST endpoints

func PostKeyResult added in v0.2.0

func PostKeyResult(w http.ResponseWriter, r *http.Request)

func ResultMinusOne

func ResultMinusOne(w http.ResponseWriter, r *http.Request)

func ResultPlusOne

func ResultPlusOne(w http.ResponseWriter, r *http.Request)

@todo Combine ResultPlusOne and ResultMinusOne functions

func SaveObjectives

func SaveObjectives() (err error)

func WriteMarkdown

func WriteMarkdown(file string, objectives []*Objective) error

Types

type KeyResult

type KeyResult struct {
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	Current      int64    `json:"current"`
	Target       int64    `json:"target"`
	Contributors []string `json:"contributors"`
	Comments     []string `json:"comments"`
}

type Objective

type Objective struct {
	Name        string       `json:"name"`
	Description string       `json:"description"`
	KeyResults  []*KeyResult `json:"keyResults"`
}

func ParseHeading

func ParseHeading(node *blackfriday.Node) (*Objective, error)

func ParseMarkdown

func ParseMarkdown(path string) ([]*Objective, error)

func (*Objective) FindKeyResult

func (o *Objective) FindKeyResult(resultID string) *KeyResult

type ObjectiveWalker

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

func (ObjectiveWalker) Result

func (o ObjectiveWalker) Result() ([]*Objective, error)

func (*ObjectiveWalker) Walk

func (o *ObjectiveWalker) Walk(node *blackfriday.Node, entering bool) blackfriday.WalkStatus

type Objectives

type Objectives []*Objective

func (Objectives) FindObjective

func (o Objectives) FindObjective(objectiveID int) *Objective

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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