journal

package
v0.0.0-...-42aae50 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TimestampFormat = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func ByEntryDate

func ByEntryDate(entries []Entry) func(i, j int) bool

func ByTimestamp

func ByTimestamp(entriesFound []Entry) func(i, j int) bool

Types

type Entry

type Entry struct {
	Timestamp time.Time
	EntryDate date.Date
	EntryText string
}

type Index

type Index interface {
	Add(id string, text string)
	Search(query string) []Rank
}

type Journal

type Journal struct {
	Data  TabularData
	Index Index
}

func (*Journal) AddEntry

func (j *Journal) AddEntry(entryDate date.Date, text string) error

func (*Journal) DeleteEntry

func (j *Journal) DeleteEntry(entryDate date.Date) error

func (*Journal) GetClosestEntry

func (j *Journal) GetClosestEntry(entryDate date.Date) (Entry, error)

func (*Journal) GetEntries

func (j *Journal) GetEntries(timeRange string) ([]Entry, error)

func (*Journal) GetEntry

func (j *Journal) GetEntry(entryDate date.Date) (string, error)

func (*Journal) SearchFor

func (j *Journal) SearchFor(query string) ([]Entry, error)

type Rank

type Rank struct {
	Result     string
	Confidence float32
}

type TabularData

type TabularData interface {
	Rows() ([][]string, error)
	AppendRow(row []string) error
	Empty() (bool, error)
	DeleteRow(rowNum int) error
}

Jump to

Keyboard shortcuts

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