2020-05-15 16:59:37 +02:00
|
|
|
// +build !kvdb_etcd
|
|
|
|
|
|
|
|
package kvdb
|
|
|
|
|
|
|
|
import (
|
2020-05-25 18:08:58 +02:00
|
|
|
"context"
|
2020-05-15 16:59:37 +02:00
|
|
|
"fmt"
|
2021-02-09 20:19:31 +01:00
|
|
|
|
|
|
|
"github.com/lightningnetwork/lnd/channeldb/kvdb/etcd"
|
2020-05-15 16:59:37 +02: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")
|
|
|
|
|
|
|
|
// GetEtcdBackend is a stub returning nil and errEtcdNotAvailable error.
|
2021-02-09 20:19:31 +01:00
|
|
|
func GetEtcdBackend(ctx context.Context, etcdConfig *etcd.Config) (
|
2021-02-09 17:56:42 +01:00
|
|
|
Backend, error) {
|
2020-05-25 18:08:58 +02:00
|
|
|
|
2020-05-15 16:59:37 +02:00
|
|
|
return nil, errEtcdNotAvailable
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetTestEtcdBackend is a stub returning nil, an empty closure and an
|
|
|
|
// errEtcdNotAvailable error.
|
2021-01-06 19:40:30 +01:00
|
|
|
func GetEtcdTestBackend(path string, clientPort, peerPort uint16) (
|
|
|
|
Backend, func(), error) {
|
|
|
|
|
2020-05-15 16:59:37 +02:00
|
|
|
return nil, func() {}, errEtcdNotAvailable
|
|
|
|
}
|