當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Scheme.AddKnownTypeWithName方法代碼示例

本文整理匯總了Golang中k8s/io/kubernetes/pkg/runtime.Scheme.AddKnownTypeWithName方法的典型用法代碼示例。如果您正苦於以下問題:Golang Scheme.AddKnownTypeWithName方法的具體用法?Golang Scheme.AddKnownTypeWithName怎麽用?Golang Scheme.AddKnownTypeWithName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在k8s/io/kubernetes/pkg/runtime.Scheme的用法示例。


在下文中一共展示了Scheme.AddKnownTypeWithName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: addKnownTypes

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&Template{},
		&TemplateList{},
	)

	scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("TemplateConfig"), &Template{})
	scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ProcessedTemplate"), &Template{})
}
開發者ID:RomainVabre,項目名稱:origin,代碼行數:10,代碼來源:register.go

示例2: AddToGroupVersion

// AddToGroupVersion registers the watch external and internal kinds with the scheme, and ensures the proper
// conversions are in place.
func AddToGroupVersion(scheme *runtime.Scheme, groupVersion unversioned.GroupVersion) {
	scheme.AddKnownTypeWithName(groupVersion.WithKind(WatchEventKind), &Event{})
	scheme.AddKnownTypeWithName(
		unversioned.GroupVersion{Group: groupVersion.Group, Version: runtime.APIVersionInternal}.WithKind(WatchEventKind),
		&InternalEvent{},
	)
	scheme.AddConversionFuncs(
		Convert_versioned_Event_to_watch_Event,
		Convert_versioned_InternalEvent_to_versioned_Event,
		Convert_watch_Event_to_versioned_Event,
		Convert_versioned_Event_to_versioned_InternalEvent,
	)
}
開發者ID:CodeJuan,項目名稱:kubernetes,代碼行數:15,代碼來源:register.go

示例3: addKnownTypes

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&Job{},
		&JobList{},
		&JobTemplate{},
		&CronJob{},
		&CronJobList{},
		&api.ListOptions{},
	)
	scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJob"), &CronJob{})
	scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJobList"), &CronJobList{})
	return nil
}
開發者ID:eljefedelrodeodeljefe,項目名稱:kubernetes,代碼行數:14,代碼來源:register.go

示例4: addKnownTypes

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&Job{},
		&JobList{},
		&JobTemplate{},
		&CronJob{},
		&CronJobList{},
		&v1.ListOptions{},
		&v1.DeleteOptions{},
	)
	scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJob"), &CronJob{})
	scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJobList"), &CronJobList{})
	versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
	return nil
}
開發者ID:eljefedelrodeodeljefe,項目名稱:kubernetes,代碼行數:16,代碼來源:register.go


注:本文中的k8s/io/kubernetes/pkg/runtime.Scheme.AddKnownTypeWithName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。