Example #1
0
//setEntry stores stamp/value.
func setEntry(tx *bolt.Tx, stamp int64, filekey string) {
	sb := db.MustTob(stamp)
	fb := db.MustTob(filekey)
	err := db.Put(tx, "keylibST", sb, fb)
	if err != nil {
		panic(err)
	}
	err = db.Put(tx, "keylibTS", fb, sb)
	if err != nil {
		panic(err)
	}
}
Example #2
0
func getTime(tx *bolt.Tx, thread string) (int64, error) {
	var stamp int64
	k := db.MustTob(thread)
	_, err := db.Get(tx, "keylibTS", k, &stamp)
	return stamp, err
}
Example #3
0
func getThread(tx *bolt.Tx, stamp int64) (string, error) {
	var thread string
	k := db.MustTob(stamp)
	_, err := db.Get(tx, "keylibST", k, &thread)
	return thread, err
}