本文整理汇总了Golang中github.com/cloudfoundry/cli/plugin.Start函数的典型用法代码示例。如果您正苦于以下问题:Golang Start函数的具体用法?Golang Start怎么用?Golang Start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Start函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: main
func main() {
plugin.Start(new(DiegoEnabler))
}
开发者ID:cloudfoundry-incubator,项目名称:Diego-Enabler,代码行数:3,代码来源:main.go
示例17: main
func main() {
plugin.Start(new(TestWithPush))
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:test_with_push.go
示例18: main
func main() {
plugin.Start(new(TestWithHelp))
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:test_with_help.go
示例19: main
func main() {
plugin.Start(new(Wildcard))
//plugin.Start(newWildcard())
}
开发者ID:guidowb,项目名称:Wildcard_Plugin,代码行数:4,代码来源:wildcard_plugin.go
示例20: main
func main() {
plugin.Start(new(EmptyPlugin))
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:empty_plugin.go
注:本文中的github.com/cloudfoundry/cli/plugin.Start函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论