updating readme to match how scribble actually works; there was a refactor not long ago and the readme never was updated. bump to 1.0.4

This commit is contained in:
Steve Domino 2015-12-17 17:13:27 -07:00
parent 689ffedfe6
commit cffdb3f127
2 changed files with 14 additions and 9 deletions

View File

@ -25,20 +25,20 @@ if err := db.Write("fish", "onefish", fish); err != nil {
fmt.Println("Error", err) fmt.Println("Error", err)
} }
// Read all fish from the database // Read a fish from the database (passing fish by reference)
fish := []Fish{} fish := []Fish{}
if err := db.Read("fish", "", fish); err != nil { if err := db.Read("fish", "onefish", &fish); err != nil {
fmt.Println("Error", err) fmt.Println("Error", err)
} }
// Read a fish from the database // Read all fish from the database, unmarshaling the response.
fish := Fish{} records, err := db.ReadAll("fish")
if err := db.Read("fish", "onefish", fish); err != nil { if err != nil {
fmt.Println("Error", err) fmt.Println("Error", err)
} }
// Delete all fish from the database fish := []Fish{}
if err := db.Delete("fish", ""); err != nil { if err := json.Unmarhsal(records, &fish); err != nil {
fmt.Println("Error", err) fmt.Println("Error", err)
} }
@ -46,6 +46,11 @@ if err := db.Delete("fish", ""); err != nil {
if err := db.Delete("fish", "onefish"); err != nil { if err := db.Delete("fish", "onefish"); err != nil {
fmt.Println("Error", err) fmt.Println("Error", err)
} }
// Delete all fish from the database
if err := db.Delete("fish", ""); err != nil {
fmt.Println("Error", err)
}
``` ```
## Documentation ## Documentation
@ -57,7 +62,7 @@ Complete documentation is available on [godoc](http://godoc.org/github.com/nanob
- Better support for concurrency - Better support for concurrency
- Better support for sub collections - Better support for sub collections
- More methods to allow different types of reads/writes - More methods to allow different types of reads/writes
- More tests (you can never have enough) - More tests (you can never have enough!)
## Contributing ## Contributing

View File

@ -11,7 +11,7 @@ import (
"sync" "sync"
) )
const Version = "1.0.3" const Version = "1.0.4"
type ( type (