2020-05-15 17:59:37 +03:00
|
|
|
// +build !kvdb_etcd
|
|
|
|
|
|
|
|
package kvdb
|
|
|
|
|
|
|
|
import (
|
2020-05-25 19:08:58 +03:00
|
|
|
"context"
|
2020-05-15 17:59:37 +03:00
|
|
|
"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.
|
2020-05-25 19:08:58 +03:00
|
|
|
func GetEtcdBackend(ctx context.Context, prefix string,
|
|
|
|
etcdConfig *EtcdConfig) (Backend, error) {
|
|
|
|
|
2020-05-15 17:59:37 +03:00
|
|
|
return nil, errEtcdNotAvailable
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetTestEtcdBackend is a stub returning nil, an empty closure and an
|
|
|
|
// errEtcdNotAvailable error.
|
2021-01-06 21:40:30 +03:00
|
|
|
func GetEtcdTestBackend(path string, clientPort, peerPort uint16) (
|
|
|
|
Backend, func(), error) {
|
|
|
|
|
2020-05-15 17:59:37 +03:00
|
|
|
return nil, func() {}, errEtcdNotAvailable
|
|
|
|
}
|