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

Function read

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

Source from the content-addressed store, hash-verified

146}
147
148func read() {
149 if err := db.View(
150 func(tx *nutsdb.Tx) error {
151 key := []byte("name1")
152 value, err := tx.Get(bucket, key)
153 if err != nil {
154 return err
155 }
156 fmt.Println("val:", string(value))
157
158 return nil
159 }); err != nil {
160 log.Println(err)
161 }
162}
163
164func valueLen() {
165 if err := db.View(

Callers 1

mainFunction · 0.85

Calls 2

ViewMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected