github.com/decred/dcrlnd@v0.7.6/kvdb/kvdb_etcd.go (about) 1 //go:build kvdb_etcd 2 // +build kvdb_etcd 3 4 package kvdb 5 6 import ( 7 "github.com/decred/dcrlnd/kvdb/etcd" 8 ) 9 10 // TestBackend is conditionally set to etcd when the kvdb_etcd build tag is 11 // defined, allowing testing our database code with etcd backend. 12 const TestBackend = EtcdBackendName 13 14 // GetEtcdTestBackend creates an embedded etcd backend for testing 15 // storig the database at the passed path. 16 func StartEtcdTestBackend(path string, clientPort, peerPort uint16, 17 logFile string) (*etcd.Config, func(), error) { 18 19 return etcd.NewEmbeddedEtcdInstance( 20 path, clientPort, peerPort, logFile, 21 ) 22 }