package remind import ( "b612.me/stardb" "b612.me/startimer" "sync" ) type Remind struct { db stardb.StarDB tasks map[string]RemindTask mu sync.Mutex callBack func(remind RemindTask) } type RemindTask struct { ID int `db:"id"` Origin string `db:"text"` timer startimer.StarTimer Key string `db:"key"` Msg []byte `db:"msg"` } func getCreateSql() []string { return []string{ "CREATE TABLE IF NOT EXISTS remind(id INTEGER PRIMARY KEY AUTOINCREMENT,key VARCHAR(64),text TEXT,msg BLOB)", "CREATE INDEX IF NOT EXISTS key_idx ON remind (key)", } }