...

Text file src/k8s.io/apimachinery/pkg/runtime/generated.proto

Documentation: k8s.io/apimachinery/pkg/runtime

     1/*
     2Copyright The Kubernetes Authors.
     3
     4Licensed under the Apache License, Version 2.0 (the "License");
     5you may not use this file except in compliance with the License.
     6You may obtain a copy of the License at
     7
     8    http://www.apache.org/licenses/LICENSE-2.0
     9
    10Unless required by applicable law or agreed to in writing, software
    11distributed under the License is distributed on an "AS IS" BASIS,
    12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13See the License for the specific language governing permissions and
    14limitations under the License.
    15*/
    16
    17
    18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
    19
    20syntax = "proto2";
    21
    22package k8s.io.apimachinery.pkg.runtime;
    23
    24// Package-wide variables from generator "generated".
    25option go_package = "k8s.io/apimachinery/pkg/runtime";
    26
    27// RawExtension is used to hold extensions in external versions.
    28//
    29// To use this, make a field which has RawExtension as its type in your external, versioned
    30// struct, and Object in your internal struct. You also need to register your
    31// various plugin types.
    32//
    33// // Internal package:
    34//
    35// 	type MyAPIObject struct {
    36// 		runtime.TypeMeta `json:",inline"`
    37// 		MyPlugin runtime.Object `json:"myPlugin"`
    38// 	}
    39//
    40// 	type PluginA struct {
    41// 		AOption string `json:"aOption"`
    42// 	}
    43//
    44// // External package:
    45//
    46// 	type MyAPIObject struct {
    47// 		runtime.TypeMeta `json:",inline"`
    48// 		MyPlugin runtime.RawExtension `json:"myPlugin"`
    49// 	}
    50//
    51// 	type PluginA struct {
    52// 		AOption string `json:"aOption"`
    53// 	}
    54//
    55// // On the wire, the JSON will look something like this:
    56//
    57// 	{
    58// 		"kind":"MyAPIObject",
    59// 		"apiVersion":"v1",
    60// 		"myPlugin": {
    61// 			"kind":"PluginA",
    62// 			"aOption":"foo",
    63// 		},
    64// 	}
    65//
    66// So what happens? Decode first uses json or yaml to unmarshal the serialized data into
    67// your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked.
    68// The next step is to copy (using pkg/conversion) into the internal struct. The runtime
    69// package's DefaultScheme has conversion functions installed which will unpack the
    70// JSON stored in RawExtension, turning it into the correct object type, and storing it
    71// in the Object. (TODO: In the case where the object is of an unknown type, a
    72// runtime.Unknown object will be created and stored.)
    73//
    74// +k8s:deepcopy-gen=true
    75// +protobuf=true
    76// +k8s:openapi-gen=true
    77message RawExtension {
    78  // Raw is the underlying serialization of this object.
    79  //
    80  // TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data.
    81  optional bytes raw = 1;
    82}
    83
    84// TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type,
    85// like this:
    86//
    87// 	type MyAwesomeAPIObject struct {
    88// 	     runtime.TypeMeta    `json:",inline"`
    89// 	     ... // other fields
    90// 	}
    91//
    92// func (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind
    93//
    94// TypeMeta is provided here for convenience. You may use it directly from this package or define
    95// your own with the same fields.
    96//
    97// +k8s:deepcopy-gen=false
    98// +protobuf=true
    99// +k8s:openapi-gen=true
   100message TypeMeta {
   101  // +optional
   102  optional string apiVersion = 1;
   103
   104  // +optional
   105  optional string kind = 2;
   106}
   107
   108// Unknown allows api objects with unknown types to be passed-through. This can be used
   109// to deal with the API objects from a plug-in. Unknown objects still have functioning
   110// TypeMeta features-- kind, version, etc.
   111// TODO: Make this object have easy access to field based accessors and settors for
   112// metadata and field mutatation.
   113//
   114// +k8s:deepcopy-gen=true
   115// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
   116// +protobuf=true
   117// +k8s:openapi-gen=true
   118message Unknown {
   119  optional TypeMeta typeMeta = 1;
   120
   121  // Raw will hold the complete serialized object which couldn't be matched
   122  // with a registered type. Most likely, nothing should be done with this
   123  // except for passing it through the system.
   124  optional bytes raw = 2;
   125
   126  // ContentEncoding is encoding used to encode 'Raw' data.
   127  // Unspecified means no encoding.
   128  optional string contentEncoding = 3;
   129
   130  // ContentType  is serialization method used to serialize 'Raw'.
   131  // Unspecified means ContentTypeJSON.
   132  optional string contentType = 4;
   133}
   134

View as plain text