lnd.xprv/channeldb/kvdb/kvdb_no_etcd.go
Andras Banki-Horvath 9992e5c0b5
etcd: decouple embedded etcd instance startup
This refactor changes how we instantiate the etcd based Backend to allow
separate initialization and startup for the embedded instance.
2021-05-04 17:33:05 +02:00

23 lines
591 B
Go

// +build !kvdb_etcd
package kvdb
import (
"fmt"
"github.com/lightningnetwork/lnd/channeldb/kvdb/etcd"
)
// 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")
// StartEtcdTestBackend is a stub returning nil, and errEtcdNotAvailable error.
func StartEtcdTestBackend(path string, clientPort, peerPort uint16) (
*etcd.Config, func(), error) {
return nil, func() {}, errEtcdNotAvailable
}