• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang cmd.SetClientStore函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/juju/cmd.SetClientStore函数的典型用法代码示例。如果您正苦于以下问题:Golang SetClientStore函数的具体用法?Golang SetClientStore怎么用?Golang SetClientStore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了SetClientStore函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: NewDefaultsCommandForTest

// NewDefaultsCommandForTest returns a defaultsCommand with the api provided as specified.
func NewDefaultsCommandForTest(api defaultsCommandAPI, store jujuclient.ClientStore) cmd.Command {
	cmd := &defaultsCommand{
		api: api,
	}
	cmd.SetClientStore(store)
	return modelcmd.WrapController(cmd)
}
开发者ID:kat-co,项目名称:juju,代码行数:8,代码来源:export_test.go


示例2: NewAddCommandForTest

func NewAddCommandForTest(api StorageAddAPI, store jujuclient.ClientStore) cmd.Command {
	cmd := &addCommand{newAPIFunc: func() (StorageAddAPI, error) {
		return api, nil
	}}
	cmd.SetClientStore(store)
	return modelcmd.Wrap(cmd)
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:7,代码来源:export_test.go


示例3: NewShowUserCommandForTest

func NewShowUserCommandForTest(api UserInfoAPI, store jujuclient.ClientStore) cmd.Command {
	cmd := &infoCommand{infoCommandBase: infoCommandBase{
		clock: clock.WallClock,
		api:   api}}
	cmd.SetClientStore(store)
	return modelcmd.WrapController(cmd)
}
开发者ID:kat-co,项目名称:juju,代码行数:7,代码来源:export_test.go


示例4: NewGrantCommandForTest

// NewGrantCommandForTest returns a GrantCommand with the api provided as specified.
func NewGrantCommandForTest(api GrantModelAPI, store jujuclient.ClientStore) (cmd.Command, *GrantCommand) {
	cmd := &grantCommand{
		api: api,
	}
	cmd.SetClientStore(store)
	return modelcmd.WrapController(cmd), &GrantCommand{cmd}
}
开发者ID:kat-co,项目名称:juju,代码行数:8,代码来源:export_test.go


示例5: NewPoolCreateCommandForTest

func NewPoolCreateCommandForTest(api PoolCreateAPI, store jujuclient.ClientStore) cmd.Command {
	cmd := &poolCreateCommand{newAPIFunc: func() (PoolCreateAPI, error) {
		return api, nil
	}}
	cmd.SetClientStore(store)
	return modelcmd.Wrap(cmd)
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:7,代码来源:export_test.go


示例6: NewRevokeCommandForTest

// NewRevokeCommandForTest returns an revokeCommand with the api provided as specified.
func NewRevokeCommandForTest(api RevokeModelAPI, store jujuclient.ClientStore) (cmd.Command, *RevokeCommand) {
	cmd := &revokeCommand{
		api: api,
	}
	cmd.SetClientStore(store)
	return modelcmd.WrapController(cmd), &RevokeCommand{cmd}
}
开发者ID:kat-co,项目名称:juju,代码行数:8,代码来源:export_test.go


示例7: runCommand

func (s *MigrateSuite) runCommand(c *gc.C, args ...string) (*cmd.Context, error) {
	cmd := &migrateCommand{
		api: s.api,
	}
	cmd.SetClientStore(s.store)
	return testing.RunCommand(c, modelcmd.WrapController(cmd), args...)
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:7,代码来源:migrate_test.go


示例8: NewDefaultsCommandForTest

// NewDefaultsCommandForTest returns a defaultsCommand with the api provided as specified.
func NewDefaultsCommandForTest(apiRoot api.Connection, dAPI defaultsCommandAPI, cAPI cloudAPI, store jujuclient.ClientStore) cmd.Command {
	cmd := &defaultsCommand{
		newAPIRoot:     func() (api.Connection, error) { return apiRoot, nil },
		newDefaultsAPI: func(caller base.APICallCloser) defaultsCommandAPI { return dAPI },
		newCloudAPI:    func(caller base.APICallCloser) cloudAPI { return cAPI },
	}
	cmd.SetClientStore(store)
	return modelcmd.WrapController(cmd)
}
开发者ID:bac,项目名称:juju,代码行数:10,代码来源:export_test.go


示例9: TestInitErrors

func (s *ValidateToolsMetadataSuite) TestInitErrors(c *gc.C) {
	for i, t := range validateInitToolsErrorTests {
		c.Logf("test %d", i)
		cmd := &validateToolsMetadataCommand{}
		cmd.SetClientStore(s.store)
		err := coretesting.InitCommand(modelcmd.Wrap(cmd), t.args)
		c.Check(err, gc.ErrorMatches, t.err)
	}
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:9,代码来源:validatetoolsmetadata_test.go


示例10: makeCommand

func (s *MigrateSuite) makeCommand() *migrateCommand {
	cmd := &migrateCommand{
		api: s.api,
		newAPIRoot: func(jujuclient.ClientStore, string, string) (api.Connection, error) {
			return s.targetControllerAPI, nil
		},
	}
	cmd.SetClientStore(s.store)
	return cmd
}
开发者ID:kat-co,项目名称:juju,代码行数:10,代码来源:migrate_test.go


示例11: NewDestroyCommandForTest

// NewDestroyCommandForTest returns a DestroyCommand with the api provided as specified.
func NewDestroyCommandForTest(api DestroyModelAPI, store jujuclient.ClientStore) cmd.Command {
	cmd := &destroyCommand{
		api: api,
	}
	cmd.SetClientStore(store)
	return modelcmd.Wrap(
		cmd,
		modelcmd.WrapSkipDefaultModel,
		modelcmd.WrapSkipModelFlags,
	)
}
开发者ID:kat-co,项目名称:juju,代码行数:12,代码来源:export_test.go


示例12: NewDestroyCommandForTest

// NewDestroyCommandForTest returns a DestroyCommand with the api provided as specified.
func NewDestroyCommandForTest(
	api DestroyModelAPI,
	refreshFunc func(jujuclient.ClientStore, string) error, store jujuclient.ClientStore,
	sleepFunc func(time.Duration),
) cmd.Command {
	cmd := &destroyCommand{
		api:           api,
		RefreshModels: refreshFunc,
		sleepFunc:     sleepFunc,
	}
	cmd.SetClientStore(store)
	return modelcmd.Wrap(
		cmd,
		modelcmd.WrapSkipDefaultModel,
		modelcmd.WrapSkipModelFlags,
	)
}
开发者ID:bac,项目名称:juju,代码行数:18,代码来源:export_test.go


示例13: NewUpgradeCharmCommandForTest

func NewUpgradeCharmCommandForTest(
	store jujuclient.ClientStore,
	apiOpener modelcmd.APIOpener,
	deployResources resourceadapters.DeployResourcesFunc,
	resolveCharm ResolveCharmFunc,
	newCharmAdder NewCharmAdderFunc,
	newCharmClient func(api.Connection) CharmClient,
	newCharmUpgradeClient func(api.Connection) CharmUpgradeClient,
	newModelConfigGetter func(api.Connection) ModelConfigGetter,
	newResourceLister func(api.Connection) (ResourceLister, error),
) cmd.Command {
	cmd := &upgradeCharmCommand{
		DeployResources:       deployResources,
		ResolveCharm:          resolveCharm,
		NewCharmAdder:         newCharmAdder,
		NewCharmClient:        newCharmClient,
		NewCharmUpgradeClient: newCharmUpgradeClient,
		NewModelConfigGetter:  newModelConfigGetter,
		NewResourceLister:     newResourceLister,
	}
	cmd.SetClientStore(store)
	cmd.SetAPIOpener(apiOpener)
	return modelcmd.Wrap(cmd)
}
开发者ID:bac,项目名称:juju,代码行数:24,代码来源:export_test.go


示例14: runValidateImageMetadata

func runValidateImageMetadata(c *gc.C, store jujuclient.ClientStore, args ...string) (*cmd.Context, error) {
	cmd := &validateImageMetadataCommand{}
	cmd.SetClientStore(store)
	return coretesting.RunCommand(c, modelcmd.Wrap(cmd), args...)
}
开发者ID:kat-co,项目名称:juju,代码行数:5,代码来源:validateimagemetadata_test.go


示例15: NewShowCommandForTest

// NewShowCommandForTest returns a ShowCommand with the api provided as specified.
func NewShowCommandForTest(api ShowModelAPI, refreshFunc func(jujuclient.ClientStore, string) error, store jujuclient.ClientStore) cmd.Command {
	cmd := &showModelCommand{api: api, RefreshModels: refreshFunc}
	cmd.SetClientStore(store)
	return modelcmd.Wrap(cmd)
}
开发者ID:bac,项目名称:juju,代码行数:6,代码来源:export_test.go


示例16: NewDumpDBCommandForTest

// NewDumpDBCommandForTest returns a DumpDBCommand with the api provided as specified.
func NewDumpDBCommandForTest(api DumpDBAPI, store jujuclient.ClientStore) cmd.Command {
	cmd := &dumpDBCommand{api: api}
	cmd.SetClientStore(store)
	return modelcmd.WrapController(cmd)
}
开发者ID:kat-co,项目名称:juju,代码行数:6,代码来源:export_test.go


示例17: NewShowCommandForTest

// NewShowCommandForTest returns a ShowCommand with the api provided as specified.
func NewShowCommandForTest(api ShowModelAPI, store jujuclient.ClientStore) cmd.Command {
	cmd := &showModelCommand{api: api}
	cmd.SetClientStore(store)
	return modelcmd.Wrap(cmd)
}
开发者ID:kat-co,项目名称:juju,代码行数:6,代码来源:export_test.go


示例18: runSyncToolsCommand

func (s *syncToolsSuite) runSyncToolsCommand(c *gc.C, args ...string) (*cmd.Context, error) {
	cmd := &syncToolsCommand{}
	cmd.SetClientStore(s.store)
	return coretesting.RunCommand(c, modelcmd.Wrap(cmd), args...)
}
开发者ID:bac,项目名称:juju,代码行数:5,代码来源:synctools_test.go



注:本文中的github.com/juju/cmd.SetClientStore函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang cmd.SetPollDelay函数代码示例发布时间:2022-05-23
下一篇:
Golang cmd.Run函数代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap