本文整理汇总了Golang中github.com/cloudfoundry/gorouter/common.GenerateUUID函数的典型用法代码示例。如果您正苦于以下问题:Golang GenerateUUID函数的具体用法?Golang GenerateUUID怎么用?Golang GenerateUUID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GenerateUUID函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: setRequestXVcapRequestId
func setRequestXVcapRequestId(request *http.Request, logger *steno.Logger) {
uuid, err := common.GenerateUUID()
if err == nil {
request.Header.Set(router_http.VcapRequestIdHeader, uuid)
if logger != nil {
logger.Set(router_http.VcapRequestIdHeader, uuid)
}
}
}
示例2: setRequestXVcapRequestId
func setRequestXVcapRequestId(request *http.Request, logger lager.Logger) {
uuid, err := common.GenerateUUID()
if err == nil {
request.Header.Set(router_http.VcapRequestIdHeader, uuid)
if logger != nil {
logger.Debug("vcap-request-id-header-set", lager.Data{router_http.VcapRequestIdHeader: uuid})
}
}
}
示例3: greetMessage
func (r *Router) greetMessage() ([]byte, error) {
host, err := vcap.LocalIP()
if err != nil {
return nil, err
}
d := vcap.RouterStart{
vcap.GenerateUUID(),
[]string{host},
r.config.StartResponseDelayIntervalInSeconds,
}
return json.Marshal(d)
}
示例4: Register
func (a *TestApp) Register() {
rm := registerMessage{
Host: "localhost",
Port: a.port,
Uris: a.urls,
Tags: a.tags,
Dea: "dea",
App: "0",
PrivateInstanceId: common.GenerateUUID(),
}
b, _ := json.Marshal(rm)
a.mbusClient.Publish("router.register", b)
}
示例5: Register
func (a *TestApp) Register() {
uuid, _ := common.GenerateUUID()
rm := registerMessage{
Host: "localhost",
Port: a.port,
Uris: a.urls,
Tags: a.tags,
Dea: "dea",
App: "0",
StaleThresholdInSeconds: 1,
RouteServiceUrl: a.routeService,
PrivateInstanceId: uuid,
}
b, _ := json.Marshal(rm)
a.mbusClient.Publish("router.register", b)
}
示例6: setRequestXVcapRequestId
func (h *RequestHandler) setRequestXVcapRequestId() {
uuid := common.GenerateUUID()
h.request.Header.Set(router_http.VcapRequestIdHeader, uuid)
h.logger.Set(router_http.VcapRequestIdHeader, uuid)
}