本文整理汇总了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",
})