本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/commandregistry.Register函数的典型用法代码示例。如果您正苦于以下问题:Golang Register函数的具体用法?Golang Register怎么用?Golang Register使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Register函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: init
func init() {
commandregistry.Register(&CreateSpaceQuota{})
}
开发者ID:jasonkeene,项目名称:cli,代码行数:3,代码来源:create_space_quota.go
示例2: init
func init() {
commandregistry.Register(&SetEnv{})
}
开发者ID:jasonkeene,项目名称:cli,代码行数:3,代码来源:set_env.go
示例3: init
func init() {
commandregistry.Register(&RunningEnvironmentVariableGroup{})
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:running_environment_variable_group.go
示例4:
//save original command and restore later
originalSSHCodeGetter = commandregistry.Commands.FindCommand("ssh-code")
sshCodeGetter = new(commandsfakes.FakeSSHCodeGetter)
//setup fakes to correctly interact with commandregistry
sshCodeGetter.SetDependencyStub = func(_ commandregistry.Dependency, _ bool) commandregistry.Command {
return sshCodeGetter
}
sshCodeGetter.MetaDataReturns(commandregistry.CommandMetadata{Name: "ssh-code"})
})
AfterEach(func() {
//restore original command
commandregistry.Register(originalSSHCodeGetter)
})
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
//inject fake 'sshCodeGetter' into registry
commandregistry.Register(sshCodeGetter)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("ssh").SetDependency(deps, pluginCall))
}
runCommand := func(args ...string) bool {
return testcmd.RunCLICommand("ssh", args, requirementsFactory, updateCommandDependency, false, ui)
}
开发者ID:Reejoshi,项目名称:cli,代码行数:30,代码来源:ssh_test.go
示例5: init
func init() {
commandregistry.Register(&ListSpaces{})
}
开发者ID:yingkitw,项目名称:cli,代码行数:3,代码来源:spaces.go
示例6: init
func init() {
commandregistry.Register(&ShowSpace{})
}
开发者ID:jasonkeene,项目名称:cli,代码行数:3,代码来源:space.go
示例7: init
func init() {
commandregistry.Register(&DeleteServiceBroker{})
}
开发者ID:jasonkeene,项目名称:cli,代码行数:3,代码来源:delete_service_broker.go
示例8: init
func init() {
commandregistry.Register(&DeleteServiceKey{})
}
开发者ID:yingkitw,项目名称:cli,代码行数:3,代码来源:delete_service_key.go
示例9: init
func init() {
commandregistry.Register(&CreateSecurityGroup{})
}
开发者ID:yingkitw,项目名称:cli,代码行数:3,代码来源:create_security_group.go
示例10: init
func init() {
commandregistry.Register(&ListPluginRepos{})
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:list_plugin_repos.go
示例11: init
func init() {
commandregistry.Register(&unbindFromStagingGroup{})
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:unbind_staging_security_group.go
示例12: init
func init() {
commandregistry.Register(&UpdateBuildpack{})
}
开发者ID:yingkitw,项目名称:cli,代码行数:3,代码来源:update_buildpack.go
示例13:
starter *applicationfakes.FakeStarter
stopper *applicationfakes.FakeStopper
config coreconfig.Repository
app models.Application
originalStop commandregistry.Command
originalStart commandregistry.Command
deps commandregistry.Dependency
applicationReq *requirementsfakes.FakeApplicationRequirement
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = config
//inject fake 'stopper and starter' into registry
commandregistry.Register(starter)
commandregistry.Register(stopper)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("restart").SetDependency(deps, pluginCall))
}
runCommand := func(args ...string) bool {
return testcmd.RunCLICommand("restart", args, requirementsFactory, updateCommandDependency, false, ui)
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
deps = commandregistry.NewDependency(os.Stdout, new(tracefakes.FakePrinter))
requirementsFactory = new(requirementsfakes.FakeFactory)
starter = new(applicationfakes.FakeStarter)
stopper = new(applicationfakes.FakeStopper)
开发者ID:jsloyer,项目名称:cli,代码行数:31,代码来源:restart_test.go
示例14: init
func init() {
commandregistry.Register(&DeleteServiceAuthTokenFields{})
}
开发者ID:jasonkeene,项目名称:cli,代码行数:3,代码来源:delete_service_auth_token.go
示例15: init
func init() {
commandregistry.Register(&BindService{})
}
开发者ID:yingkitw,项目名称:cli,代码行数:3,代码来源:bind_service.go
示例16: init
func init() {
commandregistry.Register(&ListOrgs{})
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:orgs.go
示例17: init
func init() {
commandregistry.Register(&UnsetSpaceRole{})
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:unset_space_role.go
示例18: init
func init() {
commandregistry.Register(&SetHealthCheck{})
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:set_health_check.go
示例19: init
func init() {
commandregistry.Register(&DeleteRoute{})
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:delete_route.go
示例20: init
func init() {
commandregistry.Register(&RenameServiceBroker{})
}
开发者ID:Reejoshi,项目名称:cli,代码行数:3,代码来源:rename_service_broker.go
注:本文中的github.com/cloudfoundry/cli/cf/commandregistry.Register函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论