當前位置: 首頁>>代碼示例>>Golang>>正文


Golang services.KillService函數代碼示例

本文整理匯總了Golang中github.com/eris-ltd/eris-cli/services.KillService函數的典型用法代碼示例。如果您正苦於以下問題:Golang KillService函數的具體用法?Golang KillService怎麽用?Golang KillService使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了KillService函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: TestRmChain

func TestRmChain(t *testing.T) {
	testStartChain(t, chainName)

	do := def.NowDo()
	do.Args, do.Rm, do.RmD = []string{"keys"}, true, true
	logger.Infof("Removing keys (from tests) =>\n%s\n", do.Name)
	if e := services.KillService(do); e != nil {
		fatal(t, e)
	}

	do = def.NowDo()
	do.Name, do.Rm, do.RmD = chainName, false, false
	logger.Infof("Stopping chain (from tests) =>\t%s\n", do.Name)
	if e := KillChain(do); e != nil {
		fatal(t, e)
	}
	testExistAndRun(t, chainName, true, false)

	do = def.NowDo()
	do.Name = chainName
	do.RmD = true
	logger.Infof("Removing chain (from tests) =>\n%s\n", do.Name)
	if e := RmChain(do); e != nil {
		fatal(t, e)
	}

	testExistAndRun(t, chainName, false, false)
}
開發者ID:jeffanthony,項目名稱:eris-cli,代碼行數:28,代碼來源:chains_test.go

示例2: TestRmChain

func TestRmChain(t *testing.T) {
	testStartChain(t, chainName)

	do := def.NowDo()
	do.Operations.Args, do.Rm, do.RmD = []string{"keys"}, true, true
	log.WithField("=>", do.Name).Info("Removing keys (from tests)")
	if e := services.KillService(do); e != nil {
		tests.IfExit(e)
	}

	do = def.NowDo()
	do.Name, do.Rm, do.RmD = chainName, false, false
	log.WithField("=>", do.Name).Info("Stopping chain (from tests)")
	if e := KillChain(do); e != nil {
		tests.IfExit(e)
	}
	testExistAndRun(t, chainName, true, false)

	do = def.NowDo()
	do.Name = chainName
	do.RmD = true
	log.WithField("=>", do.Name).Info("Removing chain (from tests)")
	if e := RmChain(do); e != nil {
		tests.IfExit(e)
	}

	testExistAndRun(t, chainName, false, false)
}
開發者ID:mxjxn,項目名稱:eris-cli,代碼行數:28,代碼來源:chains_test.go

示例3: TestRmChain

func TestRmChain(t *testing.T) {
	start(t, chainName)

	do := def.NowDo()
	do.Operations.Args, do.Rm, do.RmD = []string{"keys"}, true, true
	if err := services.KillService(do); err != nil {
		t.Fatalf("expected service to be stopped, got %v", err)
	}

	do = def.NowDo()
	do.Name, do.Rm, do.RmD = chainName, false, false
	log.WithField("=>", do.Name).Info("Stopping chain (from tests)")
	if err := KillChain(do); err != nil {
		t.Fatalf("expected chain to be stopped, got %v", err)
	}
	if n := util.HowManyContainersExisting(chainName, def.TypeChain); n != 1 {
		t.Fatalf("expecting 1 chain containers, got %v", n)
	}

	do = def.NowDo()
	do.Name = chainName
	do.RmD = true
	log.WithField("=>", do.Name).Info("Removing chain (from tests)")
	if err := RmChain(do); err != nil {
		t.Fatalf("expected chain to be removed, got %v", err)
	}
	if n := util.HowManyContainersExisting(chainName, def.TypeChain); n != 0 {
		t.Fatalf("expecting 0 chain containers, got %v", n)
	}
}
開發者ID:antonylewis,項目名稱:eris-cli,代碼行數:30,代碼來源:chains_test.go

示例4: killService

func killService(name string) {
	do := def.NowDo()
	do.Name = name
	do.Args = []string{name}
	do.Rm, do.RmD, do.Force = true, true, true
	if e := services.KillService(do); e != nil {
		logger.Errorln(e)
		fatal(nil, e)
	}
}
開發者ID:jeffanthony,項目名稱:eris-cli,代碼行數:10,代碼來源:chains_test.go

示例5: testKillIPFS

func testKillIPFS(t *testing.T) {
	serviceName := "ipfs"
	logger.Debugf("Stopping serv (via tests) =>\t%s\n", serviceName)

	do := definitions.NowDo()
	do.Name = serviceName
	do.Operations.Args = []string{serviceName}
	do.Rm = true
	do.RmD = true
	if e := services.KillService(do); e != nil {
		t.Fatal(e)
	}
}
開發者ID:alexandrev,項目名稱:eris-cli,代碼行數:13,代碼來源:files_test.go

示例6: kill

func kill(t *testing.T, chain string) {
	do := def.NowDo()
	do.Operations.Args, do.Rm, do.RmD = []string{"keys"}, true, true
	if err := services.KillService(do); err != nil {
		t.Fatalf("killing keys service failed: %v", err)
	}

	do = def.NowDo()
	do.Name, do.Rm, do.RmD = chain, true, true
	if err := KillChain(do); err != nil {
		t.Fatalf("killing chain failed: %v", err)
	}
}
開發者ID:antonylewis,項目名稱:eris-cli,代碼行數:13,代碼來源:chains_test.go

示例7: testKillService

func testKillService(t *testing.T, serviceName string, wipe bool) {
	logger.Debugf("Stopping serv (via tests) =>\t%s\n", serviceName)

	do := def.NowDo()
	do.Name = serviceName
	do.Operations.Args = []string{serviceName}
	if wipe {
		do.Rm = true
		do.RmD = true
	}
	e := srv.KillService(do)
	if e != nil {
		logger.Errorln(e)
		fatal(t, e)
	}
	testExistAndRun(t, serviceName, 1, !wipe, false)
	testNumbersExistAndRun(t, serviceName, 0, 0)
}
開發者ID:alexandrev,項目名稱:eris-cli,代碼行數:18,代碼來源:keys_test.go

示例8: testKillService

func testKillService(t *testing.T, serviceName string, wipe bool) {
	log.WithField("=>", serviceName).Debug("Stopping service (from tests)")

	do := def.NowDo()
	do.Name = serviceName
	do.Operations.Args = []string{serviceName}
	if wipe {
		do.Rm = true
		do.RmD = true
	}
	e := srv.KillService(do)
	if e != nil {
		log.Error(e)
		fatal(t, e)
	}
	testExistAndRun(t, serviceName, 1, !wipe, false)
	testNumbersExistAndRun(t, serviceName, 0, 0)
}
開發者ID:mxjxn,項目名稱:eris-cli,代碼行數:18,代碼來源:keys_test.go

示例9: testKillChain

func testKillChain(t *testing.T, chain string) {
	// log.SetLoggers(2, os.Stdout, os.Stderr)
	testExistAndRun(t, chain, true, true)

	do := def.NowDo()
	do.Args, do.Rm, do.RmD = []string{"keys"}, true, true
	logger.Infof("Killing keys (from tests) =>\n%s\n", do.Name)
	if e := services.KillService(do); e != nil {
		fatal(t, e)
	}

	do = def.NowDo()
	do.Name, do.Rm, do.RmD = chain, true, true
	logger.Infof("Stopping chain (from tests) =>\t%s\n", do.Name)
	if e := KillChain(do); e != nil {
		fatal(t, e)
	}
	testExistAndRun(t, chain, false, false)
}
開發者ID:jeffanthony,項目名稱:eris-cli,代碼行數:19,代碼來源:chains_test.go

示例10: testKillChain

func testKillChain(t *testing.T, chain string) {
	// log.SetLoggers(2, os.Stdout, os.Stderr)
	testExistAndRun(t, chain, true, true)

	do := def.NowDo()
	do.Operations.Args, do.Rm, do.RmD = []string{"keys"}, true, true
	log.WithField("=>", do.Name).Info("Stopping service (from tests)")
	if e := services.KillService(do); e != nil {
		tests.IfExit(e)
	}

	do = def.NowDo()
	do.Name, do.Rm, do.RmD = chain, true, true
	log.WithField("=>", do.Name).Info("Stopping chain (from tests)")
	if e := KillChain(do); e != nil {
		tests.IfExit(e)
	}
	testExistAndRun(t, chain, false, false)
}
開發者ID:mxjxn,項目名稱:eris-cli,代碼行數:19,代碼來源:chains_test.go

示例11: TestKillChain

func TestKillChain(t *testing.T) {
	// log.SetLoggers(2, os.Stdout, os.Stderr)
	testExistAndRun(t, chainName, true, true)

	do := def.NowDo()
	do.Args = []string{"keys"}
	if os.Getenv("TEST_IN_CIRCLE") != "true" {
		do.Rm = true
		do.RmD = true
	}
	logger.Infof("Removing keys (from tests) =>\n%s\n", do.Name)
	e := services.KillService(do)
	if e != nil {
		logger.Errorln(e)
		t.Fail()
	}

	do = def.NowDo()
	do.Name = chainName
	if os.Getenv("TEST_IN_CIRCLE") != "true" {
		do.Rm = true
		do.RmD = true
	}
	logger.Infof("Stopping chain (from tests) =>\t%s\n", do.Name)
	e = KillChain(do)
	if e != nil {
		logger.Errorln(e)
		t.Fail()
	}
	if os.Getenv("TEST_IN_CIRCLE") != "true" {
		testExistAndRun(t, chainName, false, false)
	} else {
		testExistAndRun(t, chainName, true, false)
	}
	// log.SetLoggers(0, os.Stdout, os.Stderr)
}
開發者ID:slowtokyo,項目名稱:eris-cli,代碼行數:36,代碼來源:chains_test.go

示例12: KillService

func KillService(cmd *cobra.Command, args []string) {
	IfExit(ArgCheck(1, "ge", cmd, args))
	do.Args = args
	IfExit(srv.KillService(do))
}
開發者ID:kustomzone,項目名稱:eris-cli,代碼行數:5,代碼來源:services.go


注:本文中的github.com/eris-ltd/eris-cli/services.KillService函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。