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


Golang plugin.Start函數代碼示例

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


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

示例1: main

func main() {

	logOut, _ := os.OpenFile("/tmp/firehose.stdout.log", os.O_WRONLY|os.O_APPEND|os.O_SYNC, 0755)
	logErr, _ := os.OpenFile("/tmp/firehose.stderr.log", os.O_WRONLY|os.O_APPEND|os.O_SYNC, 0755)
	os.Stdout = logOut
	os.Stderr = logErr

	// if err != nil {
	//     t.Fatalf("error opening file: %v", err)
	// }
	defer logOut.Close()
	defer logErr.Close()

	// Any initialization for your plugin can be handled here
	//
	// Note: to run the plugin.Start method, we pass in a pointer to the struct
	// implementing the interface defined at "github.com/cloudfoundry/cli/plugin/plugin.go"
	//
	// Note: The plugin's main() method is invoked at install time to collect
	// metadata. The plugin will exit 0 and the Run([]string) method will not be
	// invoked.
	fmt.Print("Starting plugin\n")

	plugin.Start(new(FirehoseInspector))
	// Plugin code should be written in the Run([]string) method,
	// ensuring the plugin environment is bootstrapped.
}
開發者ID:cloudfoundry-community,項目名稱:firehose_inspector,代碼行數:27,代碼來源:firehose_inspector.go

示例2: main

/*
* Unlike most Go programs, the `Main()` function will not be used to run all of the
* commands provided in your plugin. Main will be used to initialize the plugin
* process, as well as any dependencies you might require for your
* plugin.
 */
func main() {

	// Any initialization for your plugin can be handled here

	// Note: The plugin's main() method is invoked at install time to collect
	// metadata. The plugin will exit 0 and the Run([]string) method will not be
	// invoked.

	// About debug Locally:
	// The plugin interface hides panics from stdout, so in order to get panic info,
	// you can run this plugin outside of the plugin architecture by setting debuglocally = true.

	// example usage for local run: go run main.go download APP_NAME --overwrite 2> err.txt
	// note the lack of 'cf'

	debugLocally := false
	if debugLocally {
		var run DownloadPlugin
		run.Run(nil, os.Args[1:])
	} else {
		plugin.Start(new(DownloadPlugin))
	}

	// Plugin code should be written in the Run([]string) method,
	// ensuring the plugin environment is bootstrapped.
}
開發者ID:Aleabawa,項目名稱:cf-download,代碼行數:32,代碼來源:main.go

示例3: main

/*
* Unlike most Go programs, the `Main()` function will not be used to run all of the
* commands provided in your plugin. Main will be used to initialize the plugin
* process, as well as any dependencies you might require for your
* plugin.
 */
func main() {
	// Any initialization for your plugin can be handled here
	//
	// Note: to run the plugin.Start method, we pass in a pointer to the struct
	// implementing the interface defined at "github.com/cloudfoundry/cli/plugin/plugin.go"
	//
	// Note: The plugin's main() method is invoked at install time to collect
	// metadata. The plugin will exit 0 and the Run([]string) method will not be
	// invoked.
	plugin.Start(new(BasicPlugin))
	// Plugin code should be written in the Run([]string) method,
	// ensuring the plugin environment is bootstrapped.
}
開發者ID:tools-alexuser01,項目名稱:cli,代碼行數:19,代碼來源:basic_plugin.go

示例4: main

func main() {
	// T needs to point to a translate func, otherwise cf internals blow up
	i18n.T, _ = go_i18n.Tfunc("")
	p := CfPlugin{
		Deployer: &BlueGreenDeploy{
			ErrorFunc: func(message string, err error) {
				fmt.Printf("%v - %v\n", message, err)
				os.Exit(1)
			},
			Out: os.Stdout,
		},
	}

	plugin.Start(&p)
}
開發者ID:gerhard,項目名稱:cf-blue-green-deploy,代碼行數:15,代碼來源:main.go

示例5: main

/*
* Unlike most Go programs, the `Main()` function will not be used to run all of the
* commands provided in your plugin. Main will be used to initialize the plugin
* process, as well as any dependencies you might require for your
* plugin.
 */
func main() {
	plugin.Start(new(FastPushPlugin))
}
開發者ID:riccardomc,項目名稱:cf-fastpush-plugin,代碼行數:9,代碼來源:main.go

示例6: main

func main() {
	plugin.Start(new(IpQuery))
}
開發者ID:davidehringer,項目名稱:cf-ip-query-plugin,代碼行數:3,代碼來源:ip-query.go

示例7: main

func main() {
	plugin.Start(new(TestWithOrgs))
}
開發者ID:Reejoshi,項目名稱:cli,代碼行數:3,代碼來源:test_with_orgs.go

示例8: main

func main() {
	plugin.Start(new(MultiCmd))
}
開發者ID:Reejoshi,項目名稱:cli,代碼行數:3,代碼來源:multiple_commands.go

示例9: main

func main() {
	plugin.Start(new(UsageReportCmd))
}
開發者ID:krujos,項目名稱:usagereport-plugin,代碼行數:3,代碼來源:usagereport.go

示例10: main

func main() {
	plugin.Start(new(AppEnv))
}
開發者ID:Samze,項目名稱:appenvs,代碼行數:3,代碼來源:appenv.go

示例11: main

func main() {
	sshPlugin := &SSHPlugin{}
	plugin.Start(sshPlugin)
}
開發者ID:sykesm,項目名稱:diego-ssh,代碼行數:4,代碼來源:main.go

示例12: main

func main() {
	plugin.Start(new(dcp.DeployCloudPlugin))
}
開發者ID:xchapter7x,項目名稱:deploycloud,代碼行數:3,代碼來源:main.go

示例13: main

func main() {
	plugin.Start(new(FirehoseStatsCmd))
}
開發者ID:wfernandes,項目名稱:firehose-stats,代碼行數:3,代碼來源:main.go

示例14: main

func main() {
	plugin.Start(&OpenPlugin{})
}
開發者ID:whitfiea,項目名稱:cf-plugin-open,代碼行數:3,代碼來源:open.go

示例15: main

func main() {
	plugin.Start(new(Test2))
}
開發者ID:Reejoshi,項目名稱:cli,代碼行數:3,代碼來源:test_2.go


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