diff options
Diffstat (limited to 'bolt.go')
-rw-r--r-- | bolt.go | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -0,0 +1,15 @@ +package bolt + +import ( + "os" +) + +// Open creates and opens a database at the given path. +// If the file does not exist then it will be created automatically. +func Open(path string, mode os.FileMode) (*DB, error) { + db := &DB{} + if err := db.Open(path, mode); err != nil { + return nil, err + } + return db, nil +} |