MCPcopy
hub / github.com/cayleygraph/cayley / Open

Function Open

graph/kv/bolt/bolt.go:59–77  ·  view source on GitHub ↗
(path string, opt graph.Options)

Source from the content-addressed store, hash-verified

57}
58
59func Open(path string, opt graph.Options) (hkv.KV, error) {
60 db, err := bolt.Open(getBoltFile(path), nil)
61 if err != nil {
62 clog.Errorf("Error, couldn't open! %v", err)
63 return nil, err
64 }
65 bdb := db.DB()
66 // BoolKey returns false on non-existence. IE, Sync by default.
67 bdb.NoSync, err = opt.BoolKey("nosync", false)
68 if err != nil {
69 db.Close()
70 return nil, err
71 }
72 bdb.NoGrowSync = bdb.NoSync
73 if bdb.NoSync {
74 clog.Infof("Running in nosync mode")
75 }
76 return db, nil
77}

Callers

nothing calls this directly

Calls 5

ErrorfFunction · 0.92
InfofFunction · 0.92
getBoltFileFunction · 0.85
BoolKeyMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected