Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MessageTypeMeta = &Message{ Dep: true, Virtual: true, Name: ".k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta", ShortName: "TypeMeta", Fields: []*Field{ { Name: "kind", FieldName: "kind", Optional: true, Kind: protoreflect.StringKind, Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.", }, { Name: "api_version", FieldName: "apiVersion", Optional: true, Kind: protoreflect.StringKind, Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.", }, }, Package: ImportPackage{Path: "go.f110.dev/kubeproto/go/apis/metav1"}, } MessageObjectMeta = &Message{ Dep: true, Virtual: true, Name: ".k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta", ShortName: "ObjectMeta", Package: ImportPackage{Path: "go.f110.dev/kubeproto/go/apis/metav1"}, } MessageListMeta = &Message{ Dep: true, Virtual: true, Name: ".k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta", ShortName: "ListMeta", Package: ImportPackage{Path: "go.f110.dev/kubeproto/go/apis/metav1"}, } )
View Source
var ProtoreflectKindToJSONSchemaType = map[protoreflect.Kind]string{ protoreflect.StringKind: "string", protoreflect.Int64Kind: "integer", protoreflect.Int32Kind: "integer", protoreflect.BoolKind: "boolean", }
Functions ¶
This section is empty.
Types ¶
type Enum ¶
type Enum struct { // Name is a fully qualified enum name. Name string // ShortName is a name of enum ShortName string Values []string Package ImportPackage // External indicates that this enum is defined by imported proto. External bool }
func NewEnum ¶
func NewEnum(f *descriptorpb.FileDescriptorProto, enum *descriptorpb.EnumDescriptorProto) *Enum
func NewEnumFromEnumDescriptor ¶
func NewEnumFromEnumDescriptor(e protoreflect.EnumDescriptor, f protoreflect.FileDescriptor, external bool) *Enum
type Field ¶
type Field struct { // Name is a struct field name Name Name // FieldName is a json tag name FieldName string Kind protoreflect.Kind // Repeated indicates that this field is an array. Repeated bool // MessageName is a name of Message if Kind is MessageKind MessageName string // Description is a string of an account of this field Description string // Inline indicates the embed field Inline bool // Optional indicates that this field is an optional field. Optional bool // Embed indicates that this field is embed Embed bool // SubResource indicates that this field is the sub resource of Kind SubResource bool // contains filtered or unexported fields }
func (*Field) MapKeyValue ¶
func (f *Field) MapKeyValue() (protoreflect.FieldDescriptor, protoreflect.FieldDescriptor)
type ImportPackage ¶
type Lister ¶
type Lister struct {
// contains filtered or unexported fields
}
func NewLister ¶
func NewLister(files []string, all *protoregistry.Files, nsm *PackageNamespaceManager) *Lister
func (*Lister) GetMessages ¶
type Message ¶
type Message struct { // Dep indicates that this message is dependent Dep bool // Name is a fully qualified message name that includes a package name. (e,g, .k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta) Name string // ShortName is a name of message (e,g, TypeMeta) ShortName string // Kind indicates this message is runtime.Object. Kind bool // Fields has all fields of the message. Fields Fields // Virtual indicates that the message is not defined protobuf. Virtual bool AdditionalPrinterColumns []*kubeproto.PrinterColumn Package ImportPackage // Group is the api group (e,g, authorization.k8s.io) Group string SubGroup string // Version is the api version (e,g, v1alpha1) Version string // Scope is a type of this message. Scope ScopeType // HasTypeMeta indicates this message contains TypeMeta HasTypeMeta bool // contains filtered or unexported fields }
func NewMessageFromMessageDescriptor ¶
func NewMessageFromMessageDescriptor(m protoreflect.MessageDescriptor, f protoreflect.FileDescriptor, nsm *PackageNamespaceManager) (*Message, error)
func (*Message) ClientName ¶
func (*Message) IsDefinedSubResource ¶
func (*Message) Kubernetes ¶
func (m *Message) Kubernetes() (*kubeproto.Kubernetes, error)
type PackageNamespaceManager ¶
type PackageNamespaceManager struct {
// contains filtered or unexported fields
}
func NewPackageNamespaceManager ¶
func NewPackageNamespaceManager() *PackageNamespaceManager
func (*PackageNamespaceManager) Add ¶
func (m *PackageNamespaceManager) Add(importPath, packageName string) string
Add will manages new package namespace and returns the alias for importPath. packageName argument is an optional.
func (*PackageNamespaceManager) Alias ¶
func (m *PackageNamespaceManager) Alias(importPath string) string
func (*PackageNamespaceManager) All ¶
func (m *PackageNamespaceManager) All() map[string]string
Click to show internal directories.
Click to hide internal directories.