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

Function main

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

Source from the content-addressed store, hash-verified

36}
37
38func main() {
39 // create bucket first
40 createBucket()
41
42 // insert
43 put()
44 // read
45 read()
46
47 // delete
48 delete()
49 // read
50 read()
51
52 // insert
53 put()
54 // read
55 read()
56
57 // update
58 put2()
59 // read
60 read()
61
62 // get value length
63 valueLen()
64
65 // get new value and old value
66 getSet()
67 // read
68 read()
69
70 //put if not exists
71 put3()
72
73 //put if exits
74 put4()
75
76 // get remaining TTL
77 getTTL()
78
79 // save name2 as persistent
80 persist()
81
82 // get uncommitted update in same transaction
83 getUncommittedUpdateInSameTransaction()
84}
85
86func createBucket() {
87 if err := db.Update(

Callers

nothing calls this directly

Calls 12

readFunction · 0.85
deleteFunction · 0.85
put2Function · 0.85
valueLenFunction · 0.85
getSetFunction · 0.85
put3Function · 0.85
put4Function · 0.85
getTTLFunction · 0.85
persistFunction · 0.85
createBucketFunction · 0.70
putFunction · 0.70

Tested by

no test coverage detected