k8s/io/kubernetes/pkg/api.RequestContextMapper 示例代码

2022-03-03

以下示例是关于golang中包含api.RequestContextMapper用法的示例代码,想了解api.RequestContextMapper的具体用法?api.RequestContextMapper怎么用?api.RequestContextMapper使用的例子?那么可以参考以下10个相关示例代码来学习它的具体使用方法。

示例1:
master.go开发语言: Go项目名称: kubernetes代码行数: 593
93	// Map requests to contexts. Exported so downstream consumers can provider their own mappers
94	RequestContextMapper api.RequestContextMapper
95
138	v1beta3               bool
139	requestContextMapper  api.RequestContextMapper
140
564// api_v1beta1 returns the resources and codec for API version v1beta1.
565func (m *Master) api_v1beta1() (map[string]apiserver.RESTStorage, runtime.Codec, string, string, runtime.SelfLinker, admission.Interface, api.RequestContextMapper, meta.RESTMapper) {
566	storage := make(map[string]apiserver.RESTStorage)
573// api_v1beta2 returns the resources and codec for API version v1beta2.
574func (m *Master) api_v1beta2() (map[string]apiserver.RESTStorage, runtime.Codec, string, string, runtime.SelfLinker, admission.Interface, api.RequestContextMapper, meta.RESTMapper) {
575	storage := make(map[string]apiserver.RESTStorage)
582// api_v1beta3 returns the resources and codec for API version v1beta3.
583func (m *Master) api_v1beta3() (map[string]apiserver.RESTStorage, runtime.Codec, string, string, runtime.SelfLinker, admission.Interface, api.RequestContextMapper, meta.RESTMapper) {
584	storage := make(map[string]apiserver.RESTStorage)
示例2:
handlers.go开发语言: Go项目名称: kubernetes代码行数: 362
157type requestAttributeGetter struct {
158	requestContextMapper   api.RequestContextMapper
159	apiRequestInfoResolver *APIRequestInfoResolver
162// NewAttributeGetter returns an object which implements the RequestAttributeGetter interface.
163func NewRequestAttributeGetter(requestContextMapper api.RequestContextMapper, restMapper meta.RESTMapper, apiRoots ...string) RequestAttributeGetter {
164	return &requestAttributeGetter{requestContextMapper, &APIRequestInfoResolver{util.NewStringSet(apiRoots...), restMapper}}
示例3:
genericapiserver.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 963
135	// Map requests to contexts. Exported so downstream consumers can provider their own mappers
136	RequestContextMapper api.RequestContextMapper
137
232	MasterCount           int
233	RequestContextMapper  api.RequestContextMapper
234
示例4:
config.go开发语言: Go项目名称: cjcullen代码行数: 539
99	// Map requests to contexts. Exported so downstream consumers can provider their own mappers
100	RequestContextMapper api.RequestContextMapper
101
示例5:
genericapiserver.go开发语言: Go项目名称: cjcullen代码行数: 393
101	// requestContextMapper provides a way to get the context for a request.  It may be nil.
102	requestContextMapper api.RequestContextMapper
103
159// TODO refactor third party resource storage
160func (s *GenericAPIServer) RequestContextMapper() api.RequestContextMapper {
161	return s.requestContextMapper
示例6:
apiserver.go开发语言: Go项目名称: kubernetes代码行数: 309
100// Note: This method is used only in tests.
101func Handle(storage map[string]RESTStorage, codec runtime.Codec, root string, version string, linker runtime.SelfLinker, admissionControl admission.Interface, contextMapper api.RequestContextMapper, mapper meta.RESTMapper) http.Handler {
102	prefix := path.Join(root, version)
123	admit   admission.Interface
124	context api.RequestContextMapper
125	mapper  meta.RESTMapper
134// TODO: add multitype codec serialization
135func NewAPIGroupVersion(storage map[string]RESTStorage, codec runtime.Codec, root, prefix string, linker runtime.SelfLinker, admissionControl admission.Interface, contextMapper api.RequestContextMapper, mapper meta.RESTMapper) *APIGroupVersion {
136	return &APIGroupVersion{
示例7:
genericapiserver.go开发语言: Go项目名称: amygdala代码行数: 884
229	// Map requests to contexts. Exported so downstream consumers can provider their own mappers
230	RequestContextMapper api.RequestContextMapper
231
317	ApiGroupVersionOverrides map[string]APIGroupVersionOverride
318	RequestContextMapper     api.RequestContextMapper
319
示例8:
handlers.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 644
425type requestAttributeGetter struct {
426	requestContextMapper api.RequestContextMapper
427	requestInfoResolver  *RequestInfoResolver
430// NewAttributeGetter returns an object which implements the RequestAttributeGetter interface.
431func NewRequestAttributeGetter(requestContextMapper api.RequestContextMapper, requestInfoResolver *RequestInfoResolver) RequestAttributeGetter {
432	return &requestAttributeGetter{requestContextMapper, requestInfoResolver}
示例9:
authorization.go开发语言: Go项目名称: cjcullen代码行数: 102
62type requestAttributeGetter struct {
63	requestContextMapper api.RequestContextMapper
64}
66// NewAttributeGetter returns an object which implements the RequestAttributeGetter interface.
67func NewRequestAttributeGetter(requestContextMapper api.RequestContextMapper) RequestAttributeGetter {
68	return &requestAttributeGetter{requestContextMapper}
示例10:
apiserver_test.go开发语言: Go项目名称: cjcullen代码行数: 3421
88var admissionControl admission.Interface
89var requestContextMapper api.RequestContextMapper
90

本文地址:https://www.itbaoku.cn/snippets/415673.html