MCPcopy Index your code
hub / github.com/dearcode/candy / start

Method start

store/file.go:112–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110}
111
112func (f *fileDB) start() error {
113 var err error
114
115 path := fmt.Sprintf("%s/%s", f.root, util.FileDBPath)
116 log.Debugf("path:%v", path)
117 if f.db, err = leveldb.OpenFile(path, nil); err != nil {
118 return errors.Trace(err)
119 }
120
121 if err = os.MkdirAll(fmt.Sprintf("%s/%s", f.root, util.FileBlockPath), os.ModePerm); err != nil {
122 return errors.Trace(err)
123 }
124
125 go f.closeFile()
126
127 return nil
128}
129
130// check master file size
131func (f *fileDB) isFull() bool {

Callers 7

StartMethod · 0.45
initFunction · 0.45
TestUserDBFunction · 0.45
TestUserLastMessageFunction · 0.45
TestUserMessageFunction · 0.45
TestUserMessageReverseFunction · 0.45
TestMessageDBFunction · 0.45

Calls 1

closeFileMethod · 0.95

Tested by 6

initFunction · 0.36
TestUserDBFunction · 0.36
TestUserLastMessageFunction · 0.36
TestUserMessageFunction · 0.36
TestUserMessageReverseFunction · 0.36
TestMessageDBFunction · 0.36