Skip to content

vaughan0/go-gdbm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-gdbm

go-gdbm provides Go bindings for the GNU database manager. The go-gdbm project is licensed under the MIT license.

You can view the API documentation here.

Basic Usage

Open a database:

db, err := gdbm.Open("my-stuff.db")
if err != nil {
  panic(err)
}
defer db.Close()

Store some data:

db.Store([]byte("strawberry"), []byte("red"))
db.Store([]byte("banana"), []byte("yellow"))

To delete an entry, call Store with nil as the second parameter.

To retrieve data for a key:

value := db.Fetch([]byte("strawberry"))
if string(value) != "red" {
  panic("oh no!")
}

About

GDBM bindings for Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages