Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
diskv
✓ github.com/peterbourgon/diskv/v3
Creates a diskv store, writes a key-value pair, and reads it back.
package main
import (
"fmt"
"github.com/peterbourgon/diskv/v3"
)
func main() {
d := diskv.New(diskv.Options{
BasePath: "/tmp/mystore",
Transform: func(s string) []string { return []string{} },
CacheSizeMax: 1024 * 1024,
})
d.Write("key", []byte("value"))
value, err := d.Read("key")
if err != nil {
panic(err)
}
fmt.Println("Value:", string(value))
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
3.0.1latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.