本文整理匯總了Golang中github.com/cloudfoundry-incubator/lattice/ltc/app_runner.AppRunner類的典型用法代碼示例。如果您正苦於以下問題:Golang AppRunner類的具體用法?Golang AppRunner怎麽用?Golang AppRunner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了AppRunner類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
. "github.com/onsi/gomega"
"github.com/cloudfoundry-incubator/lattice/ltc/app_runner"
"github.com/cloudfoundry-incubator/lattice/ltc/app_runner/fake_keygen"
"github.com/cloudfoundry-incubator/lattice/ltc/logs/reserved_app_ids"
"github.com/cloudfoundry-incubator/lattice/ltc/route_helpers"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/fake_receptor"
"github.com/cloudfoundry-incubator/runtime-schema/models"
)
var _ = Describe("AppRunner", func() {
var (
fakeReceptorClient *fake_receptor.FakeClient
fakeKeyGenerator *fake_keygen.FakeKeyGenerator
appRunner app_runner.AppRunner
)
BeforeEach(func() {
fakeReceptorClient = &fake_receptor.FakeClient{}
fakeKeyGenerator = &fake_keygen.FakeKeyGenerator{}
appRunner = app_runner.New(fakeReceptorClient, "myDiegoInstall.com", fakeKeyGenerator)
fakeKeyGenerator.GenerateRSAPrivateKeyReturns("THIS IS A PRIVATE HOST KEY", nil)
fakeKeyGenerator.GenerateRSAKeyPairReturns("THIS IS A PRIVATE KEY", "THIS IS A PUBLIC KEY", nil)
})
Describe("CreateApp", func() {
var createAppParams app_runner.CreateAppParams
示例2:
. "github.com/cloudfoundry-incubator/lattice/ltc/test_helpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry-incubator/lattice/ltc/app_runner"
"github.com/cloudfoundry-incubator/lattice/ltc/logs/reserved_app_ids"
"github.com/cloudfoundry-incubator/lattice/ltc/route_helpers"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/fake_receptor"
"github.com/cloudfoundry-incubator/runtime-schema/models"
)
var _ = Describe("AppRunner", func() {
var (
fakeReceptorClient *fake_receptor.FakeClient
appRunner app_runner.AppRunner
)
BeforeEach(func() {
fakeReceptorClient = &fake_receptor.FakeClient{}
appRunner = app_runner.New(fakeReceptorClient, "myDiegoInstall.com")
})
Describe("CreateApp", func() {
It("Upserts lattice domain so that it is always fresh, then starts the Docker App", func() {
args := []string{"app", "arg1", "--app", "arg 2"}
envs := map[string]string{"APPROOT": "/root/env/path"}
err := appRunner.CreateApp(app_runner.CreateAppParams{
AppEnvironmentParams: app_runner.AppEnvironmentParams{
EnvironmentVariables: envs,
Privileged: false,