helper

package
v0.0.0-...-19b1c6b Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2016 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgsToEntryValues

func ArgsToEntryValues(args []string, addTimeStamp time.Time, rawTimeStamp string) (
	data.ProjectName,
	time.Time,
	string,
	error)

ArgsToEntryValues will take the given args and try to parse the parameters and flags to the values a normaly entry (note, todo, etc.) would need.

func ArgsToTodo

func ArgsToTodo(args []string, addTimeStamp time.Time, rawTimeStamp string) (data.ProjectName, data.Todo, error)

ArgsToTodo will take the given args and parameters and try to convert them to a todo.

func Debug

func Debug(args ...interface{})

Debug is a shortcut to log debug messages.

func DefaultOrRawTimestamp

func DefaultOrRawTimestamp(timestamp time.Time, raw string) (time.Time, error)

DefaultOrRawTimestamp will compare the timestamp and the raw timestamp to each other and return the given timestamp if the raw and the timestamp are the same. Else it will parse the raw timestamp and return that. This is mostly used for determining if a timestamp flag was given or not (see commands package).

func DefaultStore

func DefaultStore(datadir string) (store.Store, error)

DefaultStore will return the default store used in the software. This is only to make it easy to change the store type.

func ErrExit

func ErrExit(err error)

ErrExit will check if the underlying error is nil and if its not it will print a debug and fatal message and exit the program.

func Fatal

func Fatal(args ...interface{})

Fatal is a shortcut to log fatal messages. This will exit the program after printing the message.

func ProjectNamesFromArgs

func ProjectNamesFromArgs(store store.Store, args []string, showarchive bool) (data.Projects, error)

ProjectNamesFromArgs will return all projects or all projects with subprojects if the length of the args is not 0.

func RecordEntry

func RecordEntry(datadir string, project data.ProjectName, entry data.Entry, commit bool) error

RecordEntry will record the given entry for the given project using the specified datadir. This is mostly a helper function which will inizialize the store and then record the entry to the store.

Types

This section is empty.

Jump to

Keyboard shortcuts

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