@@ -15,14 +15,14 @@ import (
1515 "github.com/syndtr/goleveldb/leveldb/util"
1616)
1717
18- type datastore struct {
18+ type Datastore struct {
1919 * accessor
2020 DB * leveldb.DB
2121 path string
2222}
2323
24- var _ ds.Datastore = (* datastore )(nil )
25- var _ ds.TxnDatastore = (* datastore )(nil )
24+ var _ ds.Datastore = (* Datastore )(nil )
25+ var _ ds.TxnDatastore = (* Datastore )(nil )
2626
2727// Options is an alias of syndtr/goleveldb/opt.Options which might be extended
2828// in the future.
@@ -31,7 +31,7 @@ type Options opt.Options
3131// NewDatastore returns a new datastore backed by leveldb
3232//
3333// for path == "", an in memory bachend will be chosen
34- func NewDatastore (path string , opts * Options ) (* datastore , error ) {
34+ func NewDatastore (path string , opts * Options ) (* Datastore , error ) {
3535 var nopts opt.Options
3636 if opts != nil {
3737 nopts = opt .Options (* opts )
@@ -53,7 +53,7 @@ func NewDatastore(path string, opts *Options) (*datastore, error) {
5353 return nil , err
5454 }
5555
56- return & datastore {
56+ return & Datastore {
5757 accessor : & accessor {ldb : db },
5858 DB : db ,
5959 path : path ,
@@ -233,7 +233,7 @@ func (a *accessor) runQuery(worker goprocess.Process, qrb *dsq.ResultBuilder) {
233233
234234// DiskUsage returns the current disk size used by this levelDB.
235235// For in-mem datastores, it will return 0.
236- func (d * datastore ) DiskUsage () (uint64 , error ) {
236+ func (d * Datastore ) DiskUsage () (uint64 , error ) {
237237 if d .path == "" { // in-mem
238238 return 0 , nil
239239 }
@@ -256,18 +256,18 @@ func (d *datastore) DiskUsage() (uint64, error) {
256256}
257257
258258// LevelDB needs to be closed.
259- func (d * datastore ) Close () (err error ) {
259+ func (d * Datastore ) Close () (err error ) {
260260 return d .DB .Close ()
261261}
262262
263- func (d * datastore ) IsThreadSafe () {}
263+ func (d * Datastore ) IsThreadSafe () {}
264264
265265type leveldbBatch struct {
266266 b * leveldb.Batch
267267 db * leveldb.DB
268268}
269269
270- func (d * datastore ) Batch () (ds.Batch , error ) {
270+ func (d * Datastore ) Batch () (ds.Batch , error ) {
271271 return & leveldbBatch {
272272 b : new (leveldb.Batch ),
273273 db : d .DB ,
@@ -302,7 +302,7 @@ func (t *transaction) Discard() {
302302 t .tx .Discard ()
303303}
304304
305- func (d * datastore ) NewTransaction (readOnly bool ) (ds.Txn , error ) {
305+ func (d * Datastore ) NewTransaction (readOnly bool ) (ds.Txn , error ) {
306306 tx , err := d .DB .OpenTransaction ()
307307 if err != nil {
308308 return nil , err
0 commit comments