本文整理汇总了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.
}
示例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.
}
示例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.
}
示例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)
}
示例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))
}
示例6: main
func main() {
plugin.Start(new(IpQuery))
}
示例7: main
func main() {
plugin.Start(new(TestWithOrgs))
}
示例8: main
func main() {
plugin.Start(new(MultiCmd))
}
示例9: main
func main() {
plugin.Start(new(UsageReportCmd))
}
示例11: main
func main() {
sshPlugin := &SSHPlugin{}
plugin.Start(sshPlugin)
}
示例12: main
func main() {
plugin.Start(new(dcp.DeployCloudPlugin))
}
示例13: main
func main() {
plugin.Start(new(FirehoseStatsCmd))
}
示例14: main
func main() {
plugin.Start(&OpenPlugin{})
}