k8s/io/kubernetes/pkg/api/meta.IsListType 示例代码

2022-03-03

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

示例1:
visitor.go开发语言: Go项目名称: bparees代码行数: 764
399		}
400		if !meta.IsListType(info.Object) {
401			return fn(info, nil)
408			currObj := itemsToProcess[i]
409			if !meta.IsListType(currObj) {
410				items = append(items, currObj)
674	}
675	if meta.IsListType(info.Object) {
676		return fmt.Errorf("watch is only supported on individual resources and resource collections, but a list of resources is found")
示例2:
visitor.go开发语言: Go项目名称: byxorna代码行数: 764
399		}
400		if !meta.IsListType(info.Object) {
401			return fn(info, nil)
408			currObj := itemsToProcess[i]
409			if !meta.IsListType(currObj) {
410				items = append(items, currObj)
674	}
675	if meta.IsListType(info.Object) {
676		return fmt.Errorf("watch is only supported on individual resources and resource collections, but a list of resources is found")
示例3:
visitor.go开发语言: Go项目名称: csrwng代码行数: 761
398		}
399		if !meta.IsListType(info.Object) {
400			return fn(info, nil)
407			currObj := itemsToProcess[i]
408			if !meta.IsListType(currObj) {
409				items = append(items, currObj)
671	}
672	if meta.IsListType(info.Object) {
673		return fmt.Errorf("watch is only supported on individual resources and resource collections, but a list of resources is found")
示例4:
get.go开发语言: Go项目名称: abhgupta代码行数: 704
493	rv := "0"
494	isList := meta.IsListType(obj)
495	if isList {
607
608	isList := meta.IsListType(obj)
609	if isList {
示例5:
response.go开发语言: Go项目名称: abhgupta代码行数: 195
49		case target.Kind == "PartialObjectMetadata" && target.GroupVersion() == metav1alpha1.SchemeGroupVersion:
50			if meta.IsListType(result) {
51				// TODO: this should be calculated earlier
74		case target.Kind == "PartialObjectMetadataList" && target.GroupVersion() == metav1alpha1.SchemeGroupVersion:
75			if !meta.IsListType(result) {
76				// TODO: this should be calculated earlier
示例6:
fixture.go开发语言: Go项目名称: abhgupta代码行数: 453
165
166	if !meta.IsListType(list) {
167		return nil, fmt.Errorf("%q is not a list type", listGVK.Kind)
223func (t *tracker) Add(obj runtime.Object) error {
224	if meta.IsListType(obj) {
225		return t.addList(obj, false)
示例7:
fixture.go开发语言: Go项目名称: ddysher代码行数: 464
166
167	if !meta.IsListType(list) {
168		return nil, fmt.Errorf("%q is not a list type", listGVK.Kind)
231func (t *tracker) Add(obj runtime.Object) error {
232	if meta.IsListType(obj) {
233		return t.addList(obj, false)
示例8:
fixture.go开发语言: Go项目名称: detiber代码行数: 464
166
167	if !meta.IsListType(list) {
168		return nil, fmt.Errorf("%q is not a list type", listGVK.Kind)
231func (t *tracker) Add(obj runtime.Object) error {
232	if meta.IsListType(obj) {
233		return t.addList(obj, false)
示例9:
get.go开发语言: Go项目名称: ddysher代码行数: 598
248		rv := "0"
249		isList := meta.IsListType(obj)
250		if isList {
361
362		isList := meta.IsListType(obj)
363		if isList {
示例10:
response.go开发语言: Go项目名称: ddysher代码行数: 195
49		case target.Kind == "PartialObjectMetadata" && target.GroupVersion() == metav1alpha1.SchemeGroupVersion:
50			if meta.IsListType(result) {
51				// TODO: this should be calculated earlier
74		case target.Kind == "PartialObjectMetadataList" && target.GroupVersion() == metav1alpha1.SchemeGroupVersion:
75			if !meta.IsListType(result) {
76				// TODO: this should be calculated earlier

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