import ( "github.com/cloudfoundry/storeadapter/storerunner" "github.com/cloudfoundry/storeadapter/storerunner/etcdstorerunner" ) func main() { runner := etcdstorerunner.NewETCDClusterRunner(5001, 1) runner.Start() defer runner.Stop() storeRunner := etcdstorerunner.NewETCDClusterRunner(5001, 1) storeRunner.Start() defer storeRunner.Stop() // Use the store runner for testing and development // ... }
import ( "github.com/cloudfoundry/storeadapter/storerunner" "github.com/cloudfoundry/storeadapter/storerunner/etcdstorerunner" ) func main() { // Set up etcd cluster runner runner := etcdstorerunner.NewETCDClusterRunner(5001, 1) runner.Start() defer runner.Stop() // Set up store runner storeRunner := etcdstorerunner.NewETCDClusterRunner(5001, 1) storeRunner.Start() defer storeRunner.Stop() // Populate store with test data store := storeRunner.Adapter() store.Set("/foo", []byte("bar"), nil) }This code sets up an ETCDClusterRunner instance and populates the etcd store with a single key-value pair for testing purposes. The Adapter method is used to access the store through the runner instance.