Documentation ¶
Overview ¶
Package runtime is a generated protocol buffer package.
It is generated from these files:
k8s.io/kubernetes/pkg/runtime/generated.proto
It has these top-level messages:
RawExtension TypeMeta Unknown
Index ¶
- Variables
- type RawExtension
- func (*RawExtension) Descriptor() ([]byte, []int)
- func (m *RawExtension) GetRaw() []byte
- func (m *RawExtension) Marshal() (dAtA []byte, err error)
- func (m *RawExtension) MarshalTo(dAtA []byte) (int, error)
- func (*RawExtension) ProtoMessage()
- func (m *RawExtension) Reset()
- func (m *RawExtension) Size() (n int)
- func (m *RawExtension) String() string
- func (m *RawExtension) Unmarshal(dAtA []byte) error
- type TypeMeta
- func (*TypeMeta) Descriptor() ([]byte, []int)
- func (m *TypeMeta) GetApiVersion() string
- func (m *TypeMeta) GetKind() string
- func (m *TypeMeta) Marshal() (dAtA []byte, err error)
- func (m *TypeMeta) MarshalTo(dAtA []byte) (int, error)
- func (*TypeMeta) ProtoMessage()
- func (m *TypeMeta) Reset()
- func (m *TypeMeta) Size() (n int)
- func (m *TypeMeta) String() string
- func (m *TypeMeta) Unmarshal(dAtA []byte) error
- type Unknown
- func (*Unknown) Descriptor() ([]byte, []int)
- func (m *Unknown) GetContentEncoding() string
- func (m *Unknown) GetContentType() string
- func (m *Unknown) GetRaw() []byte
- func (m *Unknown) GetTypeMeta() *TypeMeta
- func (m *Unknown) Marshal() (dAtA []byte, err error)
- func (m *Unknown) MarshalTo(dAtA []byte) (int, error)
- func (*Unknown) ProtoMessage()
- func (m *Unknown) Reset()
- func (m *Unknown) Size() (n int)
- func (m *Unknown) String() string
- func (m *Unknown) Unmarshal(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") )
Functions ¶
This section is empty.
Types ¶
type RawExtension ¶
type RawExtension struct { // Raw is the underlying serialization of this object. // // TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data. Raw []byte `protobuf:"bytes,1,opt,name=raw" json:"raw,omitempty"` XXX_unrecognized []byte `json:"-"` }
RawExtension is used to hold extensions in external versions.
To use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.
// Internal package:
type MyAPIObject struct { runtime.TypeMeta `json:",inline"` MyPlugin runtime.Object `json:"myPlugin"` }
type PluginA struct { AOption string `json:"aOption"` }
// External package:
type MyAPIObject struct { runtime.TypeMeta `json:",inline"` MyPlugin runtime.RawExtension `json:"myPlugin"` }
type PluginA struct { AOption string `json:"aOption"` }
// On the wire, the JSON will look something like this:
{ "kind":"MyAPIObject", "apiVersion":"v1", "myPlugin": { "kind":"PluginA", "aOption":"foo", }, }
So what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)
+k8s:deepcopy-gen=true +protobuf=true +k8s:openapi-gen=true
func (*RawExtension) Descriptor ¶
func (*RawExtension) Descriptor() ([]byte, []int)
func (*RawExtension) GetRaw ¶
func (m *RawExtension) GetRaw() []byte
func (*RawExtension) Marshal ¶
func (m *RawExtension) Marshal() (dAtA []byte, err error)
func (*RawExtension) ProtoMessage ¶
func (*RawExtension) ProtoMessage()
func (*RawExtension) Reset ¶
func (m *RawExtension) Reset()
func (*RawExtension) Size ¶
func (m *RawExtension) Size() (n int)
func (*RawExtension) String ¶
func (m *RawExtension) String() string
func (*RawExtension) Unmarshal ¶
func (m *RawExtension) Unmarshal(dAtA []byte) error
type TypeMeta ¶
type TypeMeta struct { // +optional ApiVersion *string `protobuf:"bytes,1,opt,name=apiVersion" json:"apiVersion,omitempty"` // +optional Kind *string `protobuf:"bytes,2,opt,name=kind" json:"kind,omitempty"` XXX_unrecognized []byte `json:"-"` }
TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:
type MyAwesomeAPIObject struct { runtime.TypeMeta `json:",inline"` ... // other fields }
func (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind
TypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.
+k8s:deepcopy-gen=true +protobuf=true +k8s:openapi-gen=true
func (*TypeMeta) Descriptor ¶
func (*TypeMeta) GetApiVersion ¶
func (*TypeMeta) ProtoMessage ¶
func (*TypeMeta) ProtoMessage()
type Unknown ¶
type Unknown struct { TypeMeta *TypeMeta `protobuf:"bytes,1,opt,name=typeMeta" json:"typeMeta,omitempty"` // Raw will hold the complete serialized object which couldn't be matched // with a registered type. Most likely, nothing should be done with this // except for passing it through the system. Raw []byte `protobuf:"bytes,2,opt,name=raw" json:"raw,omitempty"` // ContentEncoding is encoding used to encode 'Raw' data. // Unspecified means no encoding. ContentEncoding *string `protobuf:"bytes,3,opt,name=contentEncoding" json:"contentEncoding,omitempty"` // ContentType is serialization method used to serialize 'Raw'. // Unspecified means ContentTypeJSON. ContentType *string `protobuf:"bytes,4,opt,name=contentType" json:"contentType,omitempty"` XXX_unrecognized []byte `json:"-"` }
Unknown allows api objects with unknown types to be passed-through. This can be used to deal with the API objects from a plug-in. Unknown objects still have functioning TypeMeta features-- kind, version, etc. TODO: Make this object have easy access to field based accessors and settors for metadata and field mutatation.
+k8s:deepcopy-gen=true +protobuf=true +k8s:openapi-gen=true
func (*Unknown) Descriptor ¶
func (*Unknown) GetContentEncoding ¶
func (*Unknown) GetContentType ¶
func (*Unknown) GetTypeMeta ¶
func (*Unknown) ProtoMessage ¶
func (*Unknown) ProtoMessage()