code: func NewDatastore(path string, opts *Options) (*Datastore, error) {
  	var nopts opt.Options
  	if opts != nil {
  		nopts = opt.Options(*opts)
  	}
  
  	var err error
  	var db *leveldb.DB
  
  	if path == "" {
  		db, err = leveldb.Open(storage.NewMemStorage(), &nopts)
  	} else {
  		db, err = leveldb.OpenFile(path, &nopts)
  		if errors.IsCorrupted(err) && !nopts.GetReadOnly() {
  			db, err = leveldb.RecoverFile(path, &nopts)
  		}
  	}
  
  	if err != nil {
  		return nil, err
  	}
  
  	return &Datastore{
  		accessor: &accessor{ldb: db},
  		DB:       db,
  		path:     path,
  	}, nil
  }
docs: // NewDatastore returns a new datastore backed by leveldb
  //
  // for path == "", an in memory bachend will be chosen