add package gsession; mv gkvdb to new repo

This commit is contained in:
John
2019-09-11 21:19:45 +08:00
parent 69684f5023
commit b39d653fe9
26 changed files with 692 additions and 1023 deletions

View File

@ -1,18 +0,0 @@
package main
import (
"log"
"github.com/dgraph-io/badger"
)
func main() {
// Open the Badger database located in the /tmp/badger directory.
// It will be created if it doesn't exist.
db, err := badger.Open(badger.DefaultOptions("/tmp/badger"))
if err != nil {
log.Fatal(err)
}
defer db.Close()
// Your code here…
}

View File

@ -1,19 +0,0 @@
package main
import (
"fmt"
"time"
"github.com/gogf/gf/database/gkvdb"
)
func main() {
key := []byte("key")
value := []byte("value")
db := gkvdb.Instance()
db.SetPath("/tmp/gkvdb/test")
db.Set(key, value)
fmt.Println(db.Get(key))
time.Sleep(time.Hour)
}