Documentation ¶
Index ¶
- Constants
- Variables
- func AddMessage(db *sql.DB, message messages.Message) error
- func ChangeTimestamp(db *sql.DB, id int, timestamp time.Time) error
- func Delete() error
- func LoadMindtick() (*sql.DB, error)
- func Messages(db *sql.DB, tag messages.Tag, rangeType Range) ([]messages.Message, error)
- func New() error
- type Range
Constants ¶
View Source
const DBFileName = "store.mindtick"
Variables ¶
View Source
var ( StrToRange = map[string]Range{ "today": TODAY, "yesterday": YESTERDAY, "week": WEEK, "month": MONTH, } RangeToStr = map[Range]string{ TODAY: "today", YESTERDAY: "yesterday", WEEK: "week", MONTH: "month", } RangeToTime = map[Range]func() time.Time{ TODAY: func() time.Time { now := time.Now() return time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) }, YESTERDAY: func() time.Time { now := time.Now() yesterday := now.AddDate(0, 0, -1) return time.Date(yesterday.Year(), yesterday.Month(), yesterday.Day(), 0, 0, 0, 0, now.Location()) }, WEEK: func() time.Time { now := time.Now() weekAgo := now.AddDate(0, 0, -7) return time.Date(weekAgo.Year(), weekAgo.Month(), weekAgo.Day(), 0, 0, 0, 0, now.Location()) }, MONTH: func() time.Time { now := time.Now() monthAgo := now.AddDate(0, -1, 0) return time.Date(monthAgo.Year(), monthAgo.Month(), monthAgo.Day(), 0, 0, 0, 0, now.Location()) }, } RangeOrder = []Range{TODAY, YESTERDAY, WEEK, MONTH} )
View Source
var COLORDBFILENAME = messages.ColorizeStr(DBFileName, messages.Purple, messages.BrightCyanBg)
Functions ¶
func ChangeTimestamp ¶ added in v0.2.0
`mindtick edit` command?
func LoadMindtick ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.