本文整理匯總了Golang中github.com/cloudfoundry/gorouter/route_service.RouteServiceConfig.GenerateSignatureAndMetadata方法的典型用法代碼示例。如果您正苦於以下問題:Golang RouteServiceConfig.GenerateSignatureAndMetadata方法的具體用法?Golang RouteServiceConfig.GenerateSignatureAndMetadata怎麽用?Golang RouteServiceConfig.GenerateSignatureAndMetadata使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/gorouter/route_service.RouteServiceConfig
的用法示例。
在下文中一共展示了RouteServiceConfig.GenerateSignatureAndMetadata方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: buildRouteServiceArgs
func buildRouteServiceArgs(routeServiceConfig *route_service.RouteServiceConfig, routeServiceUrl, forwardedUrlRaw string) (route_service.RouteServiceArgs, error) {
var routeServiceArgs route_service.RouteServiceArgs
sig, metadata, err := routeServiceConfig.GenerateSignatureAndMetadata(forwardedUrlRaw)
if err != nil {
return routeServiceArgs, err
}
routeServiceArgs.UrlString = routeServiceUrl
routeServiceArgs.Signature = sig
routeServiceArgs.Metadata = metadata
routeServiceArgs.ForwardedUrlRaw = forwardedUrlRaw
rsURL, err := url.Parse(routeServiceUrl)
if err != nil {
return routeServiceArgs, err
}
routeServiceArgs.ParsedUrl = rsURL
return routeServiceArgs, nil
}