Documentation ¶
Index ¶
- Constants
- func Add(ctx context.Context, description io.Reader, timeString string) error
- func AddDone(ctx context.Context, description io.Reader, timeString string) error
- func Base36(in int) rune
- func Bump(ctx context.Context, id string, timeString string) error
- func CreateGroup(ctx context.Context, name string, filterString string) error
- func DateFilterFn(comparison filter.FilterComparison, val string) (filter.Filter, error)
- func DefaultParser(store Store) *parser.Parser
- func DeleteGroup(ctx context.Context, name string) error
- func Do(ctx context.Context, id string) error
- func Edit(ctx context.Context, idString string, description io.Reader, timeString string) error
- func EditDataFromFile(ctx context.Context, editID string) error
- func GenerateID(at time.Time) string
- func GroupFilterFn(store Store) parser.ToFilterFn
- func IDSuffixForDate(t time.Time) string
- func Import(ctx context.Context, filename string) error
- func List(ctx context.Context, argString string, groupString string) error
- func ListGroup(ctx context.Context) error
- func ListTag(ctx context.Context) error
- func ReadToStore(ctx context.Context, f io.Reader) error
- func Rm(ctx context.Context, idString string) error
- func Show(ctx context.Context, idString string) error
- func Skip(ctx context.Context, id string) error
- func StatusFilterFn(comparison filter.FilterComparison, val string) (filter.Filter, error)
- func TagFilterFn(store Store) parser.ToFilterFn
- func TrimString(input string, extraCharacterLength int) string
- type BoltStore
- func (s *BoltStore) Delete(item *Item) error
- func (s *BoltStore) DeleteGroup(group *Group) error
- func (s *BoltStore) DropBucket(bucket string)
- func (s *BoltStore) Find(id string) (*Item, error)
- func (s *BoltStore) FindAll(id string) ([]*Item, error)
- func (s *BoltStore) FindGroupByName(name string) (*Group, error)
- func (s *BoltStore) FindTag(name string) (*Tag, error)
- func (s *BoltStore) ListFilters(filters []filter.Filter) ([]*Item, error)
- func (s *BoltStore) ListGroups() ([]*Group, error)
- func (s *BoltStore) ListTags() ([]*Tag, error)
- func (s *BoltStore) Save(item *Item) error
- func (s *BoltStore) SaveGroup(group *Group) error
- func (s *BoltStore) SaveTag(tag *Tag) error
- func (s *BoltStore) WithContext(ctx context.Context) Store
- type DateFilter
- type Group
- type GroupFilter
- type GroupStore
- type Item
- func (i *Item) Bump(newTime time.Time) *Item
- func (i *Item) Data() string
- func (i *Item) Do()
- func (i *Item) ID() string
- func (i *Item) NextID() string
- func (i *Item) PreviousID() string
- func (i *Item) ResetInternalID()
- func (i *Item) SetID(id string)
- func (i *Item) Skip()
- func (i *Item) Status() string
- func (i *Item) String() string
- func (i *Item) Tags() []*Tag
- func (i *Item) Time() time.Time
- type ItemCreator
- type ItemPrinter
- type ItemStore
- type JSONItem
- type PrintFormat
- type StatusFilter
- type Store
- type StormGroup
- type StormItem
- type StormTag
- type Tag
- type TagFilter
- type TagStore
- type TimeParser
- type Timespan
Constants ¶
View Source
const ( WaitingStatus = "waiting" DoneStatus = "done" SkippedStatus = "skipped" BumpedStatus = "bumped" )
View Source
const ( HumanPrintFormat PrintFormat = 0 TextPrintFormat PrintFormat = 1 JSONPrintFormat PrintFormat = 2 ColMinWidth int = 2 // minimum column width ColSpacesLen int = 3 // how many spaces between columns (inc newline col) LargestDateLen int = 12 // length of "- Wed Sep 23" )
View Source
const DefaultTrimAtLength = 120
View Source
const (
MaxIDLength = 6
)
Variables ¶
This section is empty.
Functions ¶
func Base36 ¶
numbers above 35 translate to the value of remainder. i.e. 36 is 0, 71 is z, 72 is 0...
func DateFilterFn ¶
func DefaultParser ¶
func GenerateID ¶
GenerateID generates a 6 digit ID - with the last three digits sortable by Year, Month, Day Format: RRRYMD - where R is a random base36 rune. This means, that in any given day, there's 36^3 chance of a random collision - acceptable for this.
func GroupFilterFn ¶
func GroupFilterFn(store Store) parser.ToFilterFn
func IDSuffixForDate ¶
func StatusFilterFn ¶
func TagFilterFn ¶
func TagFilterFn(store Store) parser.ToFilterFn
func TrimString ¶
Types ¶
type BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
func NewBoltStore ¶
func (*BoltStore) DeleteGroup ¶
func (*BoltStore) DropBucket ¶
func (*BoltStore) FindGroupByName ¶
func (*BoltStore) ListFilters ¶
func (*BoltStore) ListGroups ¶
type DateFilter ¶
type DateFilter struct {
// contains filtered or unexported fields
}
func NewDateFilter ¶
func NewDateFilter(comparison filter.FilterComparison, timespan *Timespan) *DateFilter
func (*DateFilter) Match ¶
func (dateFilter *DateFilter) Match(i interface{}) (bool, error)
func (*DateFilter) String ¶
func (dateFilter *DateFilter) String() string
type Group ¶
type GroupFilter ¶
type GroupFilter struct {
// contains filtered or unexported fields
}
func NewGroupFilter ¶
func NewGroupFilter(comparison filter.FilterComparison, name string, filters []filter.Filter) *GroupFilter
func (*GroupFilter) Match ¶
func (groupFilter *GroupFilter) Match(i interface{}) (bool, error)
func (*GroupFilter) String ¶
func (groupFilter *GroupFilter) String() string
type GroupStore ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
func (*Item) PreviousID ¶
func (*Item) ResetInternalID ¶
func (i *Item) ResetInternalID()
type ItemCreator ¶
type ItemCreator struct {
// contains filtered or unexported fields
}
func (*ItemCreator) Delete ¶
func (ic *ItemCreator) Delete(item *Item) error
func (*ItemCreator) GenerateAndSaveMetadata ¶
func (ic *ItemCreator) GenerateAndSaveMetadata(item *Item) error
type ItemPrinter ¶
type ItemPrinter struct { PrintFormat PrintFormat // contains filtered or unexported fields }
func NewItemPrinter ¶
func NewItemPrinter(ctx context.Context) *ItemPrinter
func (*ItemPrinter) Print ¶
func (ip *ItemPrinter) Print(items ...*Item)
type PrintFormat ¶
type PrintFormat int
func GetPrintFormat ¶
func GetPrintFormat(format string) PrintFormat
func GetPrintFormatFromContext ¶
func GetPrintFormatFromContext(ctx context.Context) PrintFormat
type StatusFilter ¶
type StatusFilter struct {
// contains filtered or unexported fields
}
func NewStatusFilter ¶
func NewStatusFilter(comparison filter.FilterComparison, statuses ...string) *StatusFilter
func (*StatusFilter) Match ¶
func (statusFilter *StatusFilter) Match(i interface{}) (bool, error)
func (*StatusFilter) String ¶
func (statusFilter *StatusFilter) String() string
type StormGroup ¶
type TagFilter ¶
type TagFilter struct {
// contains filtered or unexported fields
}
func NewTagFilter ¶
func NewTagFilter(store Store, comparison filter.FilterComparison, name string) *TagFilter
type TimeParser ¶
type TimeParser struct { Input string // contains filtered or unexported fields }
func (TimeParser) Parse ¶
func (tp TimeParser) Parse() (*Timespan, error)
Click to show internal directories.
Click to hide internal directories.