2020-05-15 17:59:37 +03:00
|
|
|
// +build !kvdb_etcd
|
|
|
|
|
|
|
|
package kvdb
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2021-02-09 22:19:31 +03:00
|
|
|
|
2021-04-26 20:08:11 +03:00
|
|
|
"github.com/lightningnetwork/lnd/kvdb/etcd"
|
2020-05-15 17:59:37 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// TestBackend is conditionally set to bdb when the kvdb_etcd build tag is
|
|
|
|
// not defined, allowing testing our database code with bolt backend.
|
|
|
|
const TestBackend = BoltBackendName
|
|
|
|
|
|
|
|
var errEtcdNotAvailable = fmt.Errorf("etcd backend not available")
|
|
|
|
|
2021-02-09 19:44:43 +03:00
|
|
|
// StartEtcdTestBackend is a stub returning nil, and errEtcdNotAvailable error.
|
|
|
|
func StartEtcdTestBackend(path string, clientPort, peerPort uint16) (
|
|
|
|
*etcd.Config, func(), error) {
|
2021-01-06 21:40:30 +03:00
|
|
|
|
2020-05-15 17:59:37 +03:00
|
|
|
return nil, func() {}, errEtcdNotAvailable
|
|
|
|
}
|