本文整理匯總了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)
}