ethdb: Add documentation for NewTable and NewTableBatch

This commit is contained in:
Nick Johnson 2017-01-11 09:45:59 +00:00
parent 2928bfdfc4
commit 1d5814dc2a

View file

@ -311,7 +311,9 @@ type table struct {
prefix string prefix string
} }
func NewTable(db Database, prefix string) *table { // NewTable returns a Database object that prefixes all keys with a given
// string.
func NewTable(db Database, prefix string) Database {
return &table{ return &table{
db: db, db: db,
prefix: prefix, prefix: prefix,
@ -339,7 +341,8 @@ type tableBatch struct {
prefix string prefix string
} }
func NewTableBatch(db Database, prefix string) *tableBatch { // NewTableBatch returns a Batch object which prefixes all keys with a given string.
func NewTableBatch(db Database, prefix string) *Batch {
return &tableBatch{db.NewBatch(), prefix} return &tableBatch{db.NewBatch(), prefix}
} }