本文整理匯總了Golang中code/cloudfoundry/org/cli/cf/commandregistry.Dependency類的典型用法代碼示例。如果您正苦於以下問題:Golang Dependency類的具體用法?Golang Dependency怎麽用?Golang Dependency使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Dependency類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"sync/atomic"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("start command", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
defaultAppForStart models.Application
defaultInstanceResponses [][]models.AppInstanceFields
defaultInstanceErrorCodes []string
requirementsFactory *requirementsfakes.FakeFactory
logMessages atomic.Value
logRepo *logsfakes.FakeRepository
appInstancesRepo *appinstancesfakes.FakeAppInstancesRepository
appRepo *applicationsfakes.FakeRepository
originalAppCommand commandregistry.Command
deps commandregistry.Dependency
displayApp *applicationfakes.FakeAppDisplayer
)
updateCommandDependency := func(logsRepo logs.Repository) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetLogsRepository(logsRepo)
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.RepoLocator = deps.RepoLocator.SetAppInstancesRepository(appInstancesRepo)
示例2:
"code.cloudfoundry.org/cli/cf/terminal/terminalfakes"
"code.cloudfoundry.org/cli/cf/trace/tracefakes"
. "code.cloudfoundry.org/cli/plugin/rpc"
. "code.cloudfoundry.org/cli/plugin/rpc/fakecommand"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("calling commands in commandregistry", func() {
_ = FakeCommand1{} //make sure fake_command is imported and self-registered with init()
_ = FakeCommand3{} //make sure fake_command is imported and self-registered with init()
_ = FakeCommand4{} //make sure fake_command is imported and self-registered with init()
var (
ui *terminalfakes.FakeUI
deps commandregistry.Dependency
fakeLogger *tracefakes.FakePrinter
)
BeforeEach(func() {
fakeLogger = new(tracefakes.FakePrinter)
deps = commandregistry.NewDependency(os.Stdout, fakeLogger, "")
ui = new(terminalfakes.FakeUI)
deps.UI = ui
cmd := commandregistry.Commands.FindCommand("fake-command")
commandregistry.Commands.SetCommand(cmd.SetDependency(deps, true))
cmd2 := commandregistry.Commands.FindCommand("fake-command2")
commandregistry.Commands.SetCommand(cmd2.SetDependency(deps, true))
})
示例3:
"code.cloudfoundry.org/cli/cf/models"
"code.cloudfoundry.org/cli/cf/requirements"
"code.cloudfoundry.org/cli/cf/requirements/requirementsfakes"
testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
"code.cloudfoundry.org/cli/cf/commands/buildpack"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("ListBuildpacks", func() {
var (
ui *testterm.FakeUI
buildpackRepo *apifakes.OldFakeBuildpackRepository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetBuildpackRepository(buildpackRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("buildpacks").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
buildpackRepo = new(apifakes.OldFakeBuildpackRepository)
requirementsFactory = new(requirementsfakes.FakeFactory)
})
示例4:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Install", func() {
var (
ui *testterm.FakeUI
requirementsFactory *requirementsfakes.FakeFactory
config coreconfig.Repository
pluginConfig *pluginconfigfakes.FakePluginConfiguration
fakePluginRepo *pluginrepofakes.FakePluginRepo
fakeChecksum *utilsfakes.FakeSha1Checksum
pluginFile *os.File
homeDir string
pluginDir string
curDir string
test_1 string
test_2 string
test_curDir string
test_with_help string
test_with_orgs string
test_with_orgs_short_name string
aliasConflicts string
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = config
deps.PluginConfig = pluginConfig
示例5:
testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
"code.cloudfoundry.org/cli/cf/commandregistry"
"code.cloudfoundry.org/cli/cf/commands/application"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("stop command", func() {
var (
ui *testterm.FakeUI
app models.Application
appRepo *applicationsfakes.FakeRepository
requirementsFactory *requirementsfakes.FakeFactory
config coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.Config = config
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("stop").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
appRepo = new(applicationsfakes.FakeRepository)
示例6:
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
testlogs "code.cloudfoundry.org/cli/testhelpers/logs"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
"github.com/cloudfoundry/loggregatorlib/logmessage"
"code.cloudfoundry.org/cli/cf/configuration/coreconfig"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("logs command", func() {
var (
ui *testterm.FakeUI
logsRepo *logsfakes.FakeRepository
requirementsFactory *requirementsfakes.FakeFactory
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetLogsRepository(logsRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("logs").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
logsRepo = new(logsfakes.FakeRepository)
示例7:
"code.cloudfoundry.org/cli/cf/models"
"code.cloudfoundry.org/cli/cf/requirements"
"code.cloudfoundry.org/cli/cf/requirements/requirementsfakes"
testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("staging-environment-variable-group command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *requirementsfakes.FakeFactory
configRepo coreconfig.Repository
environmentVariableGroupRepo *environmentvariablegroupsfakes.FakeRepository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetEnvironmentVariableGroupsRepository(environmentVariableGroupRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("staging-environment-variable-group").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
示例8:
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
"code.cloudfoundry.org/gofileutils/fileutils"
"code.cloudfoundry.org/cli/cf/commandregistry"
"code.cloudfoundry.org/cli/cf/trace"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("curl command", func() {
var (
ui *testterm.FakeUI
config coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
curlRepo *apifakes.OldFakeCurlRepository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetCurlRepository(curlRepo)
deps.Config = config
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("curl").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepository()
requirementsFactory = new(requirementsfakes.FakeFactory)
示例9:
"code.cloudfoundry.org/cli/cf/requirements/requirementsfakes"
testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"code.cloudfoundry.org/cli/cf/commands"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
)
var _ = Describe("stacks command", func() {
var (
ui *testterm.FakeUI
repo *stacksfakes.FakeStackRepository
config coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = config
deps.RepoLocator = deps.RepoLocator.SetStackRepository(repo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("stacks").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
示例10:
"code.cloudfoundry.org/cli/cf/api/securitygroups/spaces/spacesfakes"
spacesapifakes "code.cloudfoundry.org/cli/cf/api/spaces/spacesfakes"
testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("unbind-security-group command", func() {
var (
ui *testterm.FakeUI
securityGroupRepo *securitygroupsfakes.FakeSecurityGroupRepo
orgRepo *organizationsfakes.FakeOrganizationRepository
spaceRepo *spacesapifakes.FakeSpaceRepository
secBinder *spacesfakes.FakeSecurityGroupSpaceBinder
requirementsFactory *requirementsfakes.FakeFactory
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.RepoLocator = deps.RepoLocator.SetSecurityGroupRepository(securityGroupRepo)
deps.RepoLocator = deps.RepoLocator.SetSecurityGroupSpaceBinder(secBinder)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("unbind-security-group").SetDependency(deps, pluginCall))
}
示例11:
"code.cloudfoundry.org/cli/cf/requirements/requirementsfakes"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
"code.cloudfoundry.org/cli/cf/commandregistry"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("set-space-quota command", func() {
var (
ui *testterm.FakeUI
spaceRepo *spacesfakes.FakeSpaceRepository
quotaRepo *spacequotasfakes.FakeSpaceQuotaRepository
requirementsFactory *requirementsfakes.FakeFactory
configRepo *coreconfigfakes.FakeRepository
deps commandregistry.Dependency
cmd spacequota.SetSpaceQuota
flagContext flags.FlagContext
loginReq requirements.Requirement
orgReq *requirementsfakes.FakeTargetedOrgRequirement
)
BeforeEach(func() {
requirementsFactory = new(requirementsfakes.FakeFactory)
loginReq = requirements.Passing{Type: "login"}
requirementsFactory.NewLoginRequirementReturns(loginReq)
orgReq = new(requirementsfakes.FakeTargetedOrgRequirement)
requirementsFactory.NewTargetedOrgRequirementReturns(orgReq)
ui = new(testterm.FakeUI)
示例12:
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
"code.cloudfoundry.org/cli/cf/commandregistry"
"code.cloudfoundry.org/cli/cf/commands/serviceaccess"
"code.cloudfoundry.org/cli/cf/configuration/coreconfig"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("service-access command", func() {
var (
ui *testterm.FakeUI
actor *actorsfakes.FakeServiceActor
requirementsFactory *requirementsfakes.FakeFactory
serviceBroker1 models.ServiceBroker
serviceBroker2 models.ServiceBroker
authRepo *authenticationfakes.FakeRepository
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetAuthenticationRepository(authRepo)
deps.ServiceHandler = actor
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("service-access").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
示例13:
"code.cloudfoundry.org/cli/cf/requirements"
"code.cloudfoundry.org/cli/cf/requirements/requirementsfakes"
testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
"code.cloudfoundry.org/cli/cf/commandregistry"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("create-buildpack command", func() {
var (
requirementsFactory *requirementsfakes.FakeFactory
repo *apifakes.OldFakeBuildpackRepository
bitsRepo *apifakes.FakeBuildpackBitsRepository
ui *testterm.FakeUI
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetBuildpackRepository(repo)
deps.RepoLocator = deps.RepoLocator.SetBuildpackBitsRepository(bitsRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("create-buildpack").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
requirementsFactory = new(requirementsfakes.FakeFactory)
requirementsFactory.NewLoginRequirementReturns(requirements.Passing{})
repo = new(apifakes.OldFakeBuildpackRepository)
示例14:
"code.cloudfoundry.org/cli/cf/requirements/requirementsfakes"
testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
"code.cloudfoundry.org/cli/cf/commandregistry"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("restart-app-instance", func() {
var (
ui *testterm.FakeUI
config coreconfig.Repository
appInstancesRepo *appinstancesfakes.FakeAppInstancesRepository
requirementsFactory *requirementsfakes.FakeFactory
application models.Application
deps commandregistry.Dependency
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
appInstancesRepo = new(appinstancesfakes.FakeAppInstancesRepository)
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
requirementsFactory.NewLoginRequirementReturns(requirements.Passing{})
requirementsFactory.NewTargetedSpaceRequirementReturns(requirements.Passing{})
application = models.Application{}
application.Name = "my-app"
示例15:
"code.cloudfoundry.org/cli/cf/requirements/requirementsfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
)
var _ = Describe("delete-service-auth-token command", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
authTokenRepo *apifakes.OldFakeAuthTokenRepo
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceAuthTokenRepository(authTokenRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-service-auth-token").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
authTokenRepo = new(apifakes.OldFakeAuthTokenRepo)
configRepo = testconfig.NewRepositoryWithDefaults()