lnd.xprv/channeldb/kvdb/kvdb_no_etcd.go

25 lines
710 B
Go
Raw Normal View History

// +build !kvdb_etcd
package kvdb
import (
"fmt"
)
// 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.
func GetEtcdBackend(prefix string, etcdConfig *EtcdConfig) (Backend, error) {
return nil, errEtcdNotAvailable
}
// GetTestEtcdBackend is a stub returning nil, an empty closure and an
// errEtcdNotAvailable error.
func GetEtcdTestBackend(path, name string) (Backend, func(), error) {
return nil, func() {}, errEtcdNotAvailable
}