本文整理匯總了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{})
}