@@ -26,7 +26,7 @@ import (
26
26
datastore "github.com/ipfs/go-datastore"
27
27
leveldb "github.com/ipfs/go-ds-leveldb"
28
28
cbornode "github.com/ipfs/go-ipld-cbor"
29
- coreapi "github.com/ipfs/interface-go-ipfs- core"
29
+ coreiface "github.com/ipfs/kubo/ core/coreiface "
30
30
"github.com/libp2p/go-libp2p/core/event"
31
31
peer "github.com/libp2p/go-libp2p/core/peer"
32
32
"github.com/libp2p/go-libp2p/p2p/host/eventbus"
@@ -98,7 +98,7 @@ type orbitDB struct {
98
98
cancel context.CancelFunc
99
99
storeTypes map [string ]iface.StoreConstructor
100
100
accessControllerTypes map [string ]iface.AccessControllerConstructor
101
- ipfs coreapi .CoreAPI
101
+ ipfs coreiface .CoreAPI
102
102
identity * idp.Identity
103
103
id peer.ID
104
104
pubsub iface.PubSubInterface
@@ -136,7 +136,7 @@ func (o *orbitDB) Tracer() trace.Tracer {
136
136
return o .tracer
137
137
}
138
138
139
- func (o * orbitDB ) IPFS () coreapi .CoreAPI {
139
+ func (o * orbitDB ) IPFS () coreiface .CoreAPI {
140
140
o .muIPFS .RLock ()
141
141
defer o .muIPFS .RUnlock ()
142
142
@@ -316,7 +316,7 @@ func (o *orbitDB) getStoreConstructor(s string) (iface.StoreConstructor, bool) {
316
316
return constructor , ok
317
317
}
318
318
319
- func newOrbitDB (ctx context.Context , is coreapi .CoreAPI , identity * idp.Identity , options * NewOrbitDBOptions ) (BaseOrbitDB , error ) {
319
+ func newOrbitDB (ctx context.Context , is coreiface .CoreAPI , identity * idp.Identity , options * NewOrbitDBOptions ) (BaseOrbitDB , error ) {
320
320
if is == nil {
321
321
return nil , fmt .Errorf ("ipfs is a required argument" )
322
322
}
@@ -408,7 +408,7 @@ func newOrbitDB(ctx context.Context, is coreapi.CoreAPI, identity *idp.Identity,
408
408
}
409
409
410
410
// NewOrbitDB Creates a new OrbitDB instance
411
- func NewOrbitDB (ctx context.Context , ipfs coreapi .CoreAPI , options * NewOrbitDBOptions ) (BaseOrbitDB , error ) {
411
+ func NewOrbitDB (ctx context.Context , ipfs coreiface .CoreAPI , options * NewOrbitDBOptions ) (BaseOrbitDB , error ) {
412
412
if ipfs == nil {
413
413
return nil , fmt .Errorf ("ipfs is a required argument" )
414
414
}
@@ -571,10 +571,10 @@ func (o *orbitDB) Open(ctx context.Context, dbAddress string, options *CreateDBO
571
571
return nil , fmt .Errorf ("'options.Create' set to 'false'. If you want to create a database, set 'options.Create' to 'true'" )
572
572
} else if * options .Create && (options .StoreType == nil || * options .StoreType == "" ) {
573
573
return nil , fmt .Errorf ("database type not provided! Provide a type with 'options.StoreType' (%s)" , strings .Join (o .storeTypesNames (), "|" ))
574
- } else {
575
- options .Overwrite = boolPtr (true )
576
- return o .Create (ctx , dbAddress , * options .StoreType , options )
577
574
}
575
+
576
+ options .Overwrite = boolPtr (true )
577
+ return o .Create (ctx , dbAddress , * options .StoreType , options )
578
578
}
579
579
580
580
parsedDBAddress , err := address .Parse (dbAddress )
0 commit comments