本文整理汇总了Golang中k8s/io/kubernetes/pkg/apiserver.APIVersionHandler函数的典型用法代码示例。如果您正苦于以下问题:Golang APIVersionHandler函数的具体用法?Golang APIVersionHandler怎么用?Golang APIVersionHandler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了APIVersionHandler函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: initAPIVersionRoute
// initAPIVersionRoute initializes the osapi endpoint to behave similar to the upstream api endpoint
func initAPIVersionRoute(root *restful.WebService, prefix string, versions ...string) {
versionHandler := apiserver.APIVersionHandler(versions...)
root.Route(root.GET(prefix).To(versionHandler).
Doc("list supported server API versions").
Produces(restful.MIME_JSON).
Consumes(restful.MIME_JSON))
}
开发者ID:kcbabo,项目名称:origin,代码行数:8,代码来源:master.go
示例2: initAPIVersionRoute
// initAPIVersionRoute initializes the osapi endpoint to behave similar to the upstream api endpoint
func initAPIVersionRoute(root *restful.WebService, prefix string, versions ...string) {
versionHandler := apiserver.APIVersionHandler(kapi.Codecs, func(req *restful.Request) *unversioned.APIVersions {
apiVersionsForDiscovery := unversioned.APIVersions{
// TODO: ServerAddressByClientCIDRs: s.getServerAddressByClientCIDRs(req.Request),
Versions: versions,
}
return &apiVersionsForDiscovery
})
root.Route(root.GET(prefix).To(versionHandler).
Doc("list supported server API versions").
Produces(restful.MIME_JSON).
Consumes(restful.MIME_JSON))
}
开发者ID:pecameron,项目名称:origin,代码行数:14,代码来源:master.go
示例3: initAPIVersionRoute
// initAPIVersionRoute initializes the osapi endpoint to behave similar to the upstream api endpoint
func initAPIVersionRoute(apiContainer *genericmux.APIContainer, prefix string, versions ...string) {
versionHandler := apiserver.APIVersionHandler(kapi.Codecs, func(req *restful.Request) *unversioned.APIVersions {
apiVersionsForDiscovery := unversioned.APIVersions{
// TODO: ServerAddressByClientCIDRs: s.getServerAddressByClientCIDRs(req.Request),
Versions: versions,
}
return &apiVersionsForDiscovery
})
ws := new(restful.WebService).
Path(prefix).
Doc("list supported server API versions")
ws.Route(ws.GET("/").To(versionHandler).
Doc("list supported server API versions").
Produces(restful.MIME_JSON).
Consumes(restful.MIME_JSON).
Operation("get" + strings.Title(prefix[1:]) + "Version"))
apiContainer.Add(ws)
}
开发者ID:xgwang-zte,项目名称:origin,代码行数:19,代码来源:master.go
注:本文中的k8s/io/kubernetes/pkg/apiserver.APIVersionHandler函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论