當前位置: 首頁>>代碼示例>>Golang>>正文


Golang modelcmd.WrapController函數代碼示例

本文整理匯總了Golang中github.com/juju/juju/cmd/modelcmd.WrapController函數的典型用法代碼示例。如果您正苦於以下問題:Golang WrapController函數的具體用法?Golang WrapController怎麽用?Golang WrapController使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了WrapController函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: NewListCommand

func NewListCommand() cmd.Command {
	return modelcmd.WrapController(&listCommand{
		infoCommandBase: infoCommandBase{
			clock: clock.WallClock,
		},
	})
}
開發者ID:bac,項目名稱:juju,代碼行數:7,代碼來源:list.go

示例3: 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

示例4: 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

示例5: NewEnableDestroyControllerCommandForTest

// NewEnableDestroyControllerCommandForTest returns a enableDestroyController with the
// function used to open the API connection mocked out.
func NewEnableDestroyControllerCommandForTest(api removeBlocksAPI, store jujuclient.ClientStore) cmd.Command {
	c := &enableDestroyController{
		api: api,
	}
	c.SetClientStore(store)
	return modelcmd.WrapController(c)
}
開發者ID:bac,項目名稱:juju,代碼行數:9,代碼來源: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: NewModelsCommandForTest

// NewModelsCommandForTest returns a EnvironmentsCommand with the API
// and userCreds provided as specified.
func NewModelsCommandForTest(modelAPI ModelManagerAPI, sysAPI ModelsSysAPI, userCreds *configstore.APICredentials) cmd.Command {
	return modelcmd.WrapController(&environmentsCommand{
		modelAPI:  modelAPI,
		sysAPI:    sysAPI,
		userCreds: userCreds,
	})
}
開發者ID:pmatulis,項目名稱:juju,代碼行數:9,代碼來源:export_test.go

示例8: NewCreateModelCommandForTest

// NewCreateModelCommandForTest returns a CreateModelCommand with
// the api provided as specified.
func NewCreateModelCommandForTest(api CreateEnvironmentAPI, parser func(interface{}) (interface{}, error)) (cmd.Command, *CreateModelCommand) {
	c := &createModelCommand{
		api:          api,
		configParser: parser,
	}
	return modelcmd.WrapController(c), &CreateModelCommand{c}
}
開發者ID:pmatulis,項目名稱:juju,代碼行數:9,代碼來源:export_test.go

示例9: NewChangePasswordCommandForTest

// NewChangePasswordCommand returns a ChangePasswordCommand with the api
// and writer provided as specified.
func NewChangePasswordCommandForTest(api ChangePasswordAPI, writer EnvironInfoCredsWriter) (cmd.Command, *ChangePasswordCommand) {
	c := &changePasswordCommand{
		api:    api,
		writer: writer,
	}
	return modelcmd.WrapController(c), &ChangePasswordCommand{c}
}
開發者ID:exekias,項目名稱:juju,代碼行數:9,代碼來源:export_test.go

示例10: 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

示例11: NewUpdateCredentialCommandForTest

func NewUpdateCredentialCommandForTest(testStore jujuclient.ClientStore, api credentialAPI) cmd.Command {
	c := &updateCredentialCommand{
		api: api,
	}
	c.SetClientStore(testStore)
	return modelcmd.WrapController(c)
}
開發者ID:bac,項目名稱:juju,代碼行數:7,代碼來源:export_test.go

示例12: NewListCommandForTest

// NewListCommand returns a ListCommand with the api provided as specified.
func NewListCommandForTest(api UserInfoAPI) cmd.Command {
	c := &listCommand{
		infoCommandBase: infoCommandBase{
			api: api,
		},
	}
	return modelcmd.WrapController(c)
}
開發者ID:exekias,項目名稱:juju,代碼行數:9,代碼來源:export_test.go

示例13: NewEnableCommandForTest

// NewEnableCommand returns a EnableCommand with the api provided as
// specified.
func NewEnableCommandForTest(api disenableUserAPI) (cmd.Command, *DisenableUserBase) {
	c := &enableCommand{
		disenableUserBase{
			api: api,
		},
	}
	return modelcmd.WrapController(c), &DisenableUserBase{&c.disenableUserBase}
}
開發者ID:exekias,項目名稱:juju,代碼行數:10,代碼來源:export_test.go

示例14: NewUseModelCommandForTest

// NewUseModelCommandForTest returns a UseModelCommand with the
// API and userCreds provided as specified.
func NewUseModelCommandForTest(api UseModelAPI, userCreds *configstore.APICredentials, endpoint *configstore.APIEndpoint) (cmd.Command, *UseModelCommand) {
	c := &useModelCommand{
		api:       api,
		userCreds: userCreds,
		endpoint:  endpoint,
	}
	return modelcmd.WrapController(c), &UseModelCommand{c}
}
開發者ID:pmatulis,項目名稱:juju,代碼行數:10,代碼來源:export_test.go

示例15: NewListModelsCommandForTest

// NewListModelsCommandForTest returns a ListModelsCommand with the API
// and userCreds provided as specified.
func NewListModelsCommandForTest(modelAPI ModelManagerAPI, sysAPI ModelsSysAPI, store jujuclient.ClientStore) cmd.Command {
	c := &modelsCommand{
		modelAPI: modelAPI,
		sysAPI:   sysAPI,
	}
	c.SetClientStore(store)
	return modelcmd.WrapController(c)
}
開發者ID:bac,項目名稱:juju,代碼行數:10,代碼來源:export_test.go


注:本文中的github.com/juju/juju/cmd/modelcmd.WrapController函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。