kubernetes: github.com/erikstmartin/kubernetes/pkg/api/meta Index | Files

package meta

import "github.com/erikstmartin/kubernetes/pkg/api/meta"

Package meta provides functions for retrieving API metadata from objects belonging to the Kubernetes API

Index

Package Files

doc.go meta.go

type Interface Uses

type Interface interface {
    Namespace() string
    SetNamespace(namespace string)
    Name() string
    SetName(name string)
    UID() string
    SetUID(uid string)
    APIVersion() string
    SetAPIVersion(version string)
    Kind() string
    SetKind(kind string)
    ResourceVersion() string
    SetResourceVersion(version string)
    SelfLink() string
    SetSelfLink(selfLink string)
}

Interface lets you work with object and list metadata from any of the versioned or internal API objects. Attempting to set or retrieve a field on an object that does not support that field (Name, UID, Namespace on lists) will be a no-op and return a default value.

func Accessor Uses

func Accessor(obj interface{}) (Interface, error)

Accessor takes an arbitary object pointer and returns meta.Interface. obj must be a pointer to an API type. An error is returned if the minimum required fields are missing. Fields that are not required return the default value and are a no-op if set. TODO: add a fast path for *TypeMeta and *ObjectMeta for internal objects

type MetadataAccessor Uses

type MetadataAccessor interface {
    APIVersion(obj runtime.Object) (string, error)
    SetAPIVersion(obj runtime.Object, version string) error

    Kind(obj runtime.Object) (string, error)
    SetKind(obj runtime.Object, kind string) error

    Namespace(obj runtime.Object) (string, error)
    SetNamespace(obj runtime.Object, namespace string) error

    Name(obj runtime.Object) (string, error)
    SetName(obj runtime.Object, name string) error

    UID(obj runtime.Object) (string, error)
    SetUID(obj runtime.Object, uid string) error

    SelfLink(obj runtime.Object) (string, error)
    SetSelfLink(obj runtime.Object, selfLink string) error

    runtime.ResourceVersioner
}

MetadataAccessor lets you work with object metadata from any of the versioned or internal API objects.

func NewAccessor Uses

func NewAccessor() MetadataAccessor

NewAccessor returns a MetadataAccessor that can retrieve or manipulate resource version on objects derived from core API metadata concepts.

Package meta imports 4 packages (graph). Updated 2018-04-10. Refresh now. Tools for package owners.