NewSQLite3Storage returns the sqlite3 storage abstraction.
(rootDir string)
| 36 | |
| 37 | // NewSQLite3Storage returns the sqlite3 storage abstraction. |
| 38 | func NewSQLite3Storage(rootDir string) (s *SQLite3Storage, err error) { |
| 39 | if err = os.MkdirAll(rootDir, 0755); err != nil { |
| 40 | return |
| 41 | } |
| 42 | if rootDir, err = filepath.Abs(rootDir); err != nil { |
| 43 | return |
| 44 | } |
| 45 | return &SQLite3Storage{rootDir: rootDir}, nil |
| 46 | } |
| 47 | |
| 48 | // Create implements the Storage abstraction interface. |
| 49 | func (s *SQLite3Storage) Create(nodeCnt int) (dbID string, err error) { |