github.com/decred/dcrlnd@v0.7.6/kvdb/kvdb_no_etcd.go (about)

     1  //go:build !kvdb_etcd
     2  // +build !kvdb_etcd
     3  
     4  package kvdb
     5  
     6  import (
     7  	"fmt"
     8  
     9  	"github.com/decred/dcrlnd/kvdb/etcd"
    10  )
    11  
    12  // TestBackend is conditionally set to bdb when the kvdb_etcd build tag is
    13  // not defined, allowing testing our database code with bolt backend.
    14  const TestBackend = BoltBackendName
    15  
    16  var errEtcdNotAvailable = fmt.Errorf("etcd backend not available")
    17  
    18  // StartEtcdTestBackend  is a stub returning nil, and errEtcdNotAvailable error.
    19  func StartEtcdTestBackend(path string, clientPort, peerPort uint16,
    20  	logFile string) (*etcd.Config, func(), error) {
    21  
    22  	return nil, func() {}, errEtcdNotAvailable
    23  }