mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-06 07:06:53 +00:00
结构调整、kcp支持
This commit is contained in:
19
lib/file/csv.go
Normal file
19
lib/file/csv.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package file
|
||||
|
||||
import (
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"sync"
|
||||
)
|
||||
|
||||
var (
|
||||
CsvDb *Csv
|
||||
once sync.Once
|
||||
)
|
||||
//init csv from file
|
||||
func GetCsvDb() *Csv {
|
||||
once.Do(func() {
|
||||
CsvDb = NewCsv(common.GetRunPath())
|
||||
CsvDb.Init()
|
||||
})
|
||||
return CsvDb
|
||||
}
|
Reference in New Issue
Block a user