Movatterモバイル変換


[0]ホーム

URL:


schema

package
v0.35.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2025 License:Apache-2.0Imports:2Imported by:91,554

Details

Repository

github.com/kubernetes/apimachinery

Links

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyObjectKind = emptyObjectKind{}

EmptyObjectKind implements the ObjectKind interface as a noop

Functions

funcParseKindArg

func ParseKindArg(argstring) (*GroupVersionKind,GroupKind)

ParseKindArg takes the common style of string which may be either `Kind.group.com` or `Kind.version.group.com`and parses it out into both possibilities. This code takes no responsibility for knowing which representation was intendedbut with a knowledge of all GroupKinds, calling code can take a very good guess. If there are only two segments, then`*GroupVersionKind` is nil.`Kind.group.com` -> `group=com, version=group, kind=Kind` and `group=group.com, kind=Kind`

funcParseResourceArg

func ParseResourceArg(argstring) (*GroupVersionResource,GroupResource)

ParseResourceArg takes the common style of string which may be either `resource.group.com` or `resource.version.group.com`and parses it out into both possibilities. This code takes no responsibility for knowing which representation was intendedbut with a knowledge of all GroupVersions, calling code can take a very good guess. If there are only two segments, then`*GroupVersionResource` is nil.`resource.group.com` -> `group=com, version=group, resource=resource` and `group=group.com, resource=resource`

Types

typeGroupKind

type GroupKind struct {GroupstringKindstring}

GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifyingconcepts during lookup stages without having partially valid types

funcParseGroupKind

func ParseGroupKind(gkstring)GroupKind

func (GroupKind)Empty

func (gkGroupKind) Empty()bool

func (GroupKind)String

func (gkGroupKind) String()string

func (GroupKind)WithVersion

func (gkGroupKind) WithVersion(versionstring)GroupVersionKind

typeGroupResource

type GroupResource struct {GroupstringResourcestring}

GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifyingconcepts during lookup stages without having partially valid types

funcParseGroupResource

func ParseGroupResource(grstring)GroupResource

ParseGroupResource turns "resource.group" string into a GroupResource struct. Empty strings are allowedfor each field.

func (GroupResource)Empty

func (grGroupResource) Empty()bool

func (GroupResource)String

func (grGroupResource) String()string

func (GroupResource)WithVersion

func (grGroupResource) WithVersion(versionstring)GroupVersionResource

typeGroupVersion

type GroupVersion struct {GroupstringVersionstring}

GroupVersion contains the "group" and the "version", which uniquely identifies the API.

funcParseGroupVersion

func ParseGroupVersion(gvstring) (GroupVersion,error)

ParseGroupVersion turns "group/version" string into a GroupVersion struct. It reports errorif it cannot parse the string.

func (GroupVersion)Empty

func (gvGroupVersion) Empty()bool

Empty returns true if group and version are empty

func (GroupVersion)Identifieradded inv0.17.0

func (gvGroupVersion) Identifier()string

Identifier implements runtime.GroupVersioner interface.

func (GroupVersion)KindForGroupVersionKinds

func (gvGroupVersion) KindForGroupVersionKinds(kinds []GroupVersionKind) (targetGroupVersionKind, okbool)

KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok falseif none of the options match the group. It prefers a match to group and version over just group.TODO: Move GroupVersion to a package under pkg/runtime, since it's used by scheme.TODO: Introduce an adapter type between GroupVersion and runtime.GroupVersioner, and use LegacyCodec(GroupVersion)in fewer places.

func (GroupVersion)String

func (gvGroupVersion) String()string

String puts "group" and "version" into a single "group/version" string. For the legacy v1it returns "v1".

func (GroupVersion)WithKind

func (gvGroupVersion) WithKind(kindstring)GroupVersionKind

WithKind creates a GroupVersionKind based on the method receiver's GroupVersion and the passed Kind.

func (GroupVersion)WithResource

func (gvGroupVersion) WithResource(resourcestring)GroupVersionResource

WithResource creates a GroupVersionResource based on the method receiver's GroupVersion and the passed Resource.

typeGroupVersionKind

type GroupVersionKind struct {GroupstringVersionstringKindstring}

GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersionto avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling

funcFromAPIVersionAndKind

func FromAPIVersionAndKind(apiVersion, kindstring)GroupVersionKind

FromAPIVersionAndKind returns a GVK representing the provided fields for types thatdo not use TypeMeta. This method exists to support test types and legacy serializationsthat have a distinct group and kind.TODO: further reduce usage of this method.

func (GroupVersionKind)Empty

func (gvkGroupVersionKind) Empty()bool

Empty returns true if group, version, and kind are empty

func (GroupVersionKind)GroupKind

func (gvkGroupVersionKind) GroupKind()GroupKind

func (GroupVersionKind)GroupVersion

func (gvkGroupVersionKind) GroupVersion()GroupVersion

func (GroupVersionKind)String

func (gvkGroupVersionKind) String()string

func (GroupVersionKind)ToAPIVersionAndKind

func (gvkGroupVersionKind) ToAPIVersionAndKind() (string,string)

ToAPIVersionAndKind is a convenience method for satisfying runtime.Object on types thatdo not use TypeMeta.

typeGroupVersionResource

type GroupVersionResource struct {GroupstringVersionstringResourcestring}

GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersionto avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling

func (GroupVersionResource)Empty

func (gvrGroupVersionResource) Empty()bool

func (GroupVersionResource)GroupResource

func (gvrGroupVersionResource) GroupResource()GroupResource

func (GroupVersionResource)GroupVersion

func (gvrGroupVersionResource) GroupVersion()GroupVersion

func (GroupVersionResource)String

func (gvrGroupVersionResource) String()string

typeGroupVersions

type GroupVersions []GroupVersion

GroupVersions can be used to represent a set of desired group versions.TODO: Move GroupVersions to a package under pkg/runtime, since it's used by scheme.TODO: Introduce an adapter type between GroupVersions and runtime.GroupVersioner, and use LegacyCodec(GroupVersion)in fewer places.

func (GroupVersions)Identifieradded inv0.17.0

func (gvsGroupVersions) Identifier()string

Identifier implements runtime.GroupVersioner interface.

func (GroupVersions)KindForGroupVersionKinds

func (gvsGroupVersions) KindForGroupVersionKinds(kinds []GroupVersionKind) (GroupVersionKind,bool)

KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok falseif none of the options match the group.

typeObjectKind

type ObjectKind interface {// SetGroupVersionKind sets or clears the intended serialized kind of an object. Passing kind nil// should clear the current setting.SetGroupVersionKind(kindGroupVersionKind)// GroupVersionKind returns the stored group, version, and kind of an object, or an empty struct// if the object does not expose or provide these fields.GroupVersionKind()GroupVersionKind}

All objects that are serialized from a Scheme encode their type information. This interface is usedby serialization to set type information from the Scheme onto the serialized version of an object.For objects that cannot be serialized or have unique requirements, this interface may be a no-op.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp