本文整理匯總了Golang中github.com/cloudfoundry-incubator/bbs/fake_bbs.FakeClient.DesiredLRPByProcessGuidStub方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeClient.DesiredLRPByProcessGuidStub方法的具體用法?Golang FakeClient.DesiredLRPByProcessGuidStub怎麽用?Golang FakeClient.DesiredLRPByProcessGuidStub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry-incubator/bbs/fake_bbs.FakeClient
的用法示例。
在下文中一共展示了FakeClient.DesiredLRPByProcessGuidStub方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
var httpHandler http.Handler
httpClient = &http.Client{}
logger = lagertest.NewTestLogger("test")
bbsClient = new(fake_bbs.FakeClient)
noaaClient = &fakes.FakeNoaaClient{}
httpHandler, err = handler.New(bbsClient, noaaClient, 2, 15, logger)
Expect(err).NotTo(HaveOccurred())
server = httptest.NewServer(httpHandler)
fakeActualLRPResponses = make(chan []*models.ActualLRPGroup, 2)
bbsClient.DesiredLRPByProcessGuidStub = func(string) (*models.DesiredLRP, error) {
return &models.DesiredLRP{}, nil
}
bbsClient.ActualLRPGroupsByProcessGuidStub = func(string) ([]*models.ActualLRPGroup, error) {
return <-fakeActualLRPResponses, nil
}
noaaClient.ContainerMetricsReturns([]*events.ContainerMetric{
{
ApplicationId: proto.String("appId"),
InstanceIndex: proto.Int32(0),
CpuPercentage: proto.Float64(4),
MemoryBytes: proto.Uint64(1024),
DiskBytes: proto.Uint64(2048),
},
}, nil)