project

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoteNameSpace is the gtm git note namespace
	NoteNameSpace = "gtm-data"
	// GTMDir is the subdir for gtm within the git repo root directory
	GTMDir = ".gtm"
)

Variables

View Source
var (
	// ErrNotInitialized is raised when a git repo not initialized for time tracking
	ErrNotInitialized = errors.New("Git Time Metric is not initialized")
	// ErrFileNotFound is raised when record an event for a file that does not exist
	ErrFileNotFound = errors.New("File does not exist")
)
View Source
var (
	// GitHooks is map of hooks to apply to the git repo
	GitHooks = map[string]string{
		"post-commit": "gtm commit --yes"}
	// GitConfig is map of git configuration settings
	GitConfig = map[string]string{
		"alias.pushgtm":    "push origin refs/notes/gtm-data",
		"alias.fetchgtm":   "fetch origin refs/notes/gtm-data:refs/notes/gtm-data",
		"notes.rewriteref": "refs/notes/gtm-data"}
	// GitIgnore is file ignore to apply to git repo
	GitIgnore = "/.gtm/"
)
View Source
var Now = func() time.Time { return time.Now() }

Now is the func used for system time within gtm This allows for manipulating system time during testing

Functions

func Clean

func Clean() (string, error)

Clean removes any event or metrics files from project in the current working directory

func Initialize

func Initialize(terminal bool, tags []string, clearTags bool) (string, error)

Initialize initializes a git repo for time tracking

func Log

func Log(v ...interface{}) error

Log logs to a gtm log in the GTMDir

func Paths

func Paths(wd ...string) (string, string, error)

Paths returns the root git repo and gtm paths

func Uninitialize

func Uninitialize() (string, error)

Uninitialize remove GTM tracking from the project in the current working directory

Types

type Index

type Index struct {
	Projects map[string]time.Time
}

func NewIndex

func NewIndex() (Index, error)

func (*Index) Get

func (i *Index) Get(tags []string, all bool) ([]string, error)

Source Files

  • index.go
  • project.go

Jump to

Keyboard shortcuts

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