apimachinery: k8s.io/apimachinery/pkg/runtime/schema Index | Files

package schema

import "k8s.io/apimachinery/pkg/runtime/schema"

Package schema is a generated protocol buffer package.

It is generated from these files:

k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.proto

It has these top-level messages:

Index

Package Files

generated.pb.go group_version.go interfaces.go

Variables

var EmptyObjectKind = emptyObjectKind{}

EmptyObjectKind implements the ObjectKind interface as a noop

func ParseKindArg Uses

func ParseKindArg(arg string) (*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 intended but with a knowledge of all GroupKinds, calling code can take a very good guess. If there are only two segments, then `*GroupVersionResource` is nil. `Kind.group.com` -> `group=com, version=group, kind=Kind` and `group=group.com, kind=Kind`

func ParseResourceArg Uses

func ParseResourceArg(arg string) (*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 intended but 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`

type GroupKind Uses

type GroupKind struct {
    Group string
    Kind  string
}

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

func ParseGroupKind Uses

func ParseGroupKind(gk string) GroupKind

func (GroupKind) Empty Uses

func (gk GroupKind) Empty() bool

func (GroupKind) String Uses

func (gk GroupKind) String() string

func (GroupKind) WithVersion Uses

func (gk GroupKind) WithVersion(version string) GroupVersionKind

type GroupResource Uses

type GroupResource struct {
    Group    string
    Resource string
}

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

func ParseGroupResource Uses

func ParseGroupResource(gr string) GroupResource

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

func (GroupResource) Empty Uses

func (gr GroupResource) Empty() bool

func (GroupResource) String Uses

func (gr GroupResource) String() string

func (GroupResource) WithVersion Uses

func (gr GroupResource) WithVersion(version string) GroupVersionResource

type GroupVersion Uses

type GroupVersion struct {
    Group   string
    Version string
}

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

func ParseGroupVersion Uses

func ParseGroupVersion(gv string) (GroupVersion, error)

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

func (GroupVersion) Empty Uses

func (gv GroupVersion) Empty() bool

Empty returns true if group and version are empty

func (GroupVersion) KindForGroupVersionKinds Uses

func (gv GroupVersion) KindForGroupVersionKinds(kinds []GroupVersionKind) (target GroupVersionKind, ok bool)

KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok false if 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 Uses

func (gv GroupVersion) String() string

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

func (GroupVersion) WithKind Uses

func (gv GroupVersion) WithKind(kind string) GroupVersionKind

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

func (GroupVersion) WithResource Uses

func (gv GroupVersion) WithResource(resource string) GroupVersionResource

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

type GroupVersionKind Uses

type GroupVersionKind struct {
    Group   string
    Version string
    Kind    string
}

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

func FromAPIVersionAndKind Uses

func FromAPIVersionAndKind(apiVersion, kind string) GroupVersionKind

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

func (GroupVersionKind) Empty Uses

func (gvk GroupVersionKind) Empty() bool

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

func (GroupVersionKind) GroupKind Uses

func (gvk GroupVersionKind) GroupKind() GroupKind

func (GroupVersionKind) GroupVersion Uses

func (gvk GroupVersionKind) GroupVersion() GroupVersion

func (GroupVersionKind) String Uses

func (gvk GroupVersionKind) String() string

func (GroupVersionKind) ToAPIVersionAndKind Uses

func (gvk GroupVersionKind) ToAPIVersionAndKind() (string, string)

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

type GroupVersionResource Uses

type GroupVersionResource struct {
    Group    string
    Version  string
    Resource string
}

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

func (GroupVersionResource) Empty Uses

func (gvr GroupVersionResource) Empty() bool

func (GroupVersionResource) GroupResource Uses

func (gvr GroupVersionResource) GroupResource() GroupResource

func (GroupVersionResource) GroupVersion Uses

func (gvr GroupVersionResource) GroupVersion() GroupVersion

func (GroupVersionResource) String Uses

func (gvr GroupVersionResource) String() string

type GroupVersions Uses

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) KindForGroupVersionKinds Uses

func (gvs GroupVersions) KindForGroupVersionKinds(kinds []GroupVersionKind) (GroupVersionKind, bool)

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

type ObjectKind Uses

type ObjectKind interface {
    // SetGroupVersionKind sets or clears the intended serialized kind of an object. Passing kind nil
    // should clear the current setting.
    SetGroupVersionKind(kind GroupVersionKind)
    // GroupVersionKind returns the stored group, version, and kind of an object, or nil 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 used by 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.

Package schema imports 4 packages (graph) and is imported by 4855 packages. Updated 2018-10-12. Refresh now. Tools for package owners.