func stop(path string, controller confab.Controller, agentClient *agent.Client) { rpcClient, err := consulagent.NewRPCClient("localhost:8400") if err != nil { stderr.Printf("error connecting to RPC server: %s", err) exit(controller, 1) } agentClient.ConsulRPCClient = &agent.RPCClient{*rpcClient} stderr.Printf("stopping agent") controller.StopAgent() stderr.Printf("stopped agent") }
func configureServer(controller confab.Controller, agentClient *agent.Client, timeout confab.Timeout) { rpcClient, err := consulagent.NewRPCClient("localhost:8400") if err != nil { stderr.Printf("error connecting to RPC server: %s", err) exit(controller, 1) } agentClient.ConsulRPCClient = &agent.RPCClient{*rpcClient} err = controller.ConfigureServer(timeout) if err != nil { stderr.Printf("error configuring server: %s", err) exit(controller, 1) } }
"confab/fakes" "errors" "github.com/hashicorp/consul/api" "github.com/pivotal-golang/lager" . "github.com/pivotal-cf-experimental/gomegamatchers" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Client", func() { var ( consulAPIAgent *fakes.FakeconsulAPIAgent consulRPCClient *fakes.FakeconsulRPCClient logger *fakes.Logger client agent.Client ) BeforeEach(func() { consulAPIAgent = &fakes.FakeconsulAPIAgent{} consulRPCClient = &fakes.FakeconsulRPCClient{} logger = &fakes.Logger{} client = agent.Client{ ConsulAPIAgent: consulAPIAgent, ConsulRPCClient: consulRPCClient, Logger: logger, } }) Describe("VerifyJoined", func() {