MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / init

Function init

examples/basic/main.go:16–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14)
15
16func init() {
17 fileDir := "/tmp/nutsdb_example"
18
19 files, _ := os.ReadDir(fileDir)
20 for _, f := range files {
21 name := f.Name()
22 if name != "" {
23 fmt.Println(fileDir + "/" + name)
24 err := os.RemoveAll(fileDir + "/" + name)
25 if err != nil {
26 panic(err)
27 }
28 }
29 }
30 db, _ = nutsdb.Open(
31 nutsdb.DefaultOptions,
32 nutsdb.WithDir(fileDir),
33 nutsdb.WithSegmentSize(1024*1024), // 1MB
34 )
35 bucket = "bucketForString"
36}
37
38func main() {
39 // create bucket first

Callers

nothing calls this directly

Calls 4

OpenFunction · 0.92
WithDirFunction · 0.92
WithSegmentSizeFunction · 0.92
NameMethod · 0.65

Tested by

no test coverage detected