本文整理匯總了Golang中github.com/cloudfoundry/hm9000/config.Config.CCBaseURL方法的典型用法代碼示例。如果您正苦於以下問題:Golang Config.CCBaseURL方法的具體用法?Golang Config.CCBaseURL怎麽用?Golang Config.CCBaseURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/hm9000/config.Config
的用法示例。
在下文中一共展示了Config.CCBaseURL方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
resultChan = make(chan DesiredStateFetcherResult, 1)
timeProvider = &faketimeprovider.FakeTimeProvider{
TimeToProvide: time.Unix(100, 0),
}
httpClient = fakehttpclient.NewFakeHttpClient()
storeAdapter = fakestoreadapter.New()
store = storepackage.NewStore(conf, storeAdapter, fakelogger.NewFakeLogger())
fetcher = New(conf, store, metricsAccountant, httpClient, timeProvider, fakelogger.NewFakeLogger())
fetcher.Fetch(resultChan)
})
Describe("Fetching with an invalid URL", func() {
BeforeEach(func() {
conf.CCBaseURL = "http://example.com/#%ZZ"
fetcher = New(conf, store, metricsAccountant, httpClient, timeProvider, fakelogger.NewFakeLogger())
fetcher.Fetch(resultChan)
})
It("should send an error down the result channel", func(done Done) {
result := <-resultChan
Ω(result.Success).Should(BeFalse())
Ω(result.Message).Should(Equal("Failed to generate URL request"))
Ω(result.Error).Should(HaveOccurred())
close(done)
}, 0.1)
})
Describe("Fetching batches", func() {
var response DesiredStateServerResponse