taskr

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package taskr is built to keep you going forward. See README.md or read it at https://github.com/snwfdhmp/taskr Documentation can be found at https://godoc.org/github.com/snwfdhmp/taskr/pkg

Index

Constants

This section is empty.

Variables

View Source
var (
	WD string = "./"
)

Functions

func AddPostCommitHook

func AddPostCommitHook() error

func AddPreCommitHook

func AddPreCommitHook() error

func MkInit

func MkInit() error

func SampleTask

func SampleTask(filename string) error

Types

type History

type History struct {
	States map[string]map[string]bool
	Tip    string
}

History represents a repo runs history

func OpenHistory

func OpenHistory() (*History, error)

OpenHistory opens history from the filesystem and returns it

func (*History) Add

func (h *History) Add(commit string, testName string, testValue bool)

Add adds a key/value pair record of a test (name:state) for a specific commit

func (*History) Run

func (h *History) Run(tasks ...Task) (report RunReport, err error)

Run runs a bunch of tasks

func (*History) Save

func (h *History) Save() error

Save saves history in filesystem

type RunReport

type RunReport struct {
	Tests map[string]testReport
}

RunReport represents a run output

func NewRunReport

func NewRunReport() *RunReport

NewRunReport returns a new RunReport

func (*RunReport) Add

func (r *RunReport) Add(testName string, state bool, reward int)

Add adds a record to a run report, containing new test's state, and associated reward

func (*RunReport) Print

func (r *RunReport) Print()

Print prints a RunReport with fmt

type Task

type Task struct {
	Name   string
	Test   string
	Reward int
}

Task represents a task object

type TaskSet

type TaskSet []Task

func ParseTasks

func ParseTasks(path string) (tasks TaskSet, err error)

ParseTasks parse tasks from a file and returns them

func (*TaskSet) Save

func (t *TaskSet) Save(path string) error

Jump to

Keyboard shortcuts

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