Gregory Eremin 984a90a75c | ||
---|---|---|
filecache | ||
log | ||
set | ||
sqldb | ||
threadpool | ||
LICENSE | ||
Makefile | ||
README.md |
README.md
Gobelt
Gobelt is a collection of Go tools.
Thread pool
import "github.com/localhots/gobelt/threadpool"
ctx := context.Background()
pool := threadpool.New(5)
pool.Enqueue(ctx, func() {
fmt.Println("Hello")
})
pool.Close()
File cache
import "github.com/localhots/gobelt/filecache"
var val int
filecache.Load(&val, "path/to/cachefile", func() interface{} {
// Expensive calls here
return 100
})
Log
import "github.com/localhots/gobelt/log"
log.Info("New user signed up", log.F{
"name": u.Name,
"email": u.Email,
})
log.Errorf("Invalid database flavor: %s", flavor)