本文整理匯總了Golang中github.com/cloudfoundry/gorouter/config.Config.DropletStaleThreshold方法的典型用法代碼示例。如果您正苦於以下問題:Golang Config.DropletStaleThreshold方法的具體用法?Golang Config.DropletStaleThreshold怎麽用?Golang Config.DropletStaleThreshold使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/gorouter/config.Config
的用法示例。
在下文中一共展示了Config.DropletStaleThreshold方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: SetUpTest
func (s *RegistrySuite) SetUpTest(c *C) {
var configObj *config.Config
configObj = config.DefaultConfig()
configObj.DropletStaleThreshold = 10 * time.Millisecond
s.messageBus = fakeyagnats.New()
s.Registry = NewRegistry(configObj, s.messageBus)
fooEndpoint = &route.Endpoint{
Host: "192.168.1.1",
Port: 1234,
ApplicationId: "12345",
Tags: map[string]string{
"runtime": "ruby18",
"framework": "sinatra",
},
}
barEndpoint = &route.Endpoint{
Host: "192.168.1.2",
Port: 4321,
ApplicationId: "54321",
Tags: map[string]string{
"runtime": "javascript",
"framework": "node",
},
}
bar2Endpoint = &route.Endpoint{
Host: "192.168.1.3",
Port: 1234,
ApplicationId: "54321",
Tags: map[string]string{
"runtime": "javascript",
"framework": "node",
},
}
}
示例2:
"encoding/json"
"time"
)
var _ = Describe("RouteRegistry", func() {
var r *RouteRegistry
var messageBus *fakeyagnats.FakeYagnats
var fooEndpoint, barEndpoint, bar2Endpoint *route.Endpoint
var configObj *config.Config
BeforeEach(func() {
configObj = config.DefaultConfig()
configObj.PruneStaleDropletsInterval = 50 * time.Millisecond
configObj.DropletStaleThreshold = 10 * time.Millisecond
messageBus = fakeyagnats.New()
r = NewRouteRegistry(configObj, messageBus)
fooEndpoint = route.NewEndpoint("12345", "192.168.1.1", 1234,
"id1", map[string]string{
"runtime": "ruby18",
"framework": "sinatra",
})
barEndpoint = route.NewEndpoint("54321", "192.168.1.2", 4321,
"id2", map[string]string{
"runtime": "javascript",
"framework": "node",
})