istio: istio.io/istio/mixer/pkg/protobuf/descriptor Index | Files

package descriptor

import "istio.io/istio/mixer/pkg/protobuf/descriptor"

Index

Package Files

parser.go

Constants

const (
    // SyntaxPath is location path number for syntax statement
    SyntaxPath = "12" // syntax
    // PackagePath is location path number for package statement
    PackagePath = "2" // syntax
    // MessagePath is location path number for message statement
    MessagePath = "4" // message_type
    // EnumPath is location path number for enum statement
    EnumPath = "5" // enum_type
    // MessageFieldPath is location path number for message field statement
    MessageFieldPath = "2" // field
    // MessageMessagePath is location path number for sub-message statement
    MessageMessagePath = "3" // nested_type
    // MessageEnumPath is location path number for sub-enum statement
    MessageEnumPath = "4" // enum_type
)

func CamelCase Uses

func CamelCase(s string) string

CamelCase converts the string into camel case string

func GetPathForField Uses

func GetPathForField(desc *Descriptor, index int) string

GetPathForField returns the path associated with the field

func GoPackageName Uses

func GoPackageName(pkg string) string

GoPackageName converts proto package name into go package name.

type Descriptor Uses

type Descriptor struct {
    *descriptor.DescriptorProto

    Path string // The SourceCodeInfo path as comma-separated integers.
    // contains filtered or unexported fields
}

Descriptor wraps a DescriptorProto.

func (*Descriptor) File Uses

func (c *Descriptor) File() *descriptor.FileDescriptorProto

func (*Descriptor) PackageName Uses

func (c *Descriptor) PackageName() string

PackageName returns the Go package name for the file the common object belongs to.

func (*Descriptor) TypeName Uses

func (d *Descriptor) TypeName() []string

TypeName returns a cached typename vector.

type EnumDescriptor Uses

type EnumDescriptor struct {
    *descriptor.EnumDescriptorProto
    // contains filtered or unexported fields
}

EnumDescriptor wraps a EnumDescriptorProto.

func (*EnumDescriptor) File Uses

func (c *EnumDescriptor) File() *descriptor.FileDescriptorProto

func (*EnumDescriptor) PackageName Uses

func (c *EnumDescriptor) PackageName() string

PackageName returns the Go package name for the file the common object belongs to.

func (*EnumDescriptor) TypeName Uses

func (e *EnumDescriptor) TypeName() (s []string)

TypeName returns a cached typename vector.

type FileDescriptor Uses

type FileDescriptor struct {
    *descriptor.FileDescriptorProto
    Desc []*Descriptor // All the messages defined in this file.

    Proto3 bool // whether to generate proto3 code for this file
    // contains filtered or unexported fields
}

FileDescriptor wraps a FileDescriptorProto.

func (*FileDescriptor) GetComment Uses

func (d *FileDescriptor) GetComment(path string) string

GetComment returns the comment associated with the element at a given path.

func (*FileDescriptor) GetLineNumber Uses

func (d *FileDescriptor) GetLineNumber(path string) string

GetLineNumber returns line number for the path.

type FileDescriptorSetParser Uses

type FileDescriptorSetParser struct {
    Param             map[string]string // Command-line parameters.
    PackageImportPath string            // Go import path of the package we're generating code for
    ImportMap         map[string]string // Mapping from .proto file name to import path

    Pkg map[string]string // The names under which we import support packages

    PackageName string            // What we're calling ourselves.
    AllFiles    []*FileDescriptor // All files in the tree
    // contains filtered or unexported fields
}

FileDescriptorSetParser parses the FileDescriptorSetProto and creates an intermediate object that is used to create Model struct.

func CreateFileDescriptorSetParser Uses

func CreateFileDescriptorSetParser(fds *descriptor.FileDescriptorSet, importMap map[string]string, packageImportPath string) *FileDescriptorSetParser

CreateFileDescriptorSetParser builds a FileDescriptorSetParser instance.

func (*FileDescriptorSetParser) BuildTypeNameMap Uses

func (g *FileDescriptorSetParser) BuildTypeNameMap()

BuildTypeNameMap creates a map of type name to the wrapper Object associated with it.

func (*FileDescriptorSetParser) DefaultPackageName Uses

func (g *FileDescriptorSetParser) DefaultPackageName(obj Object) string

DefaultPackageName returns a full packagen name for the underlying Object type.

func (*FileDescriptorSetParser) Enums Uses

func (g *FileDescriptorSetParser) Enums() map[string]*descriptor.EnumDescriptorProto

Enums return a complete list of enums in the file descriptor set

func (*FileDescriptorSetParser) Messages Uses

func (g *FileDescriptorSetParser) Messages() map[string]*descriptor.DescriptorProto

Messages return a complete list of messages in the file descriptor set

func (*FileDescriptorSetParser) ObjectNamed Uses

func (g *FileDescriptorSetParser) ObjectNamed(typeName string) Object

ObjectNamed returns the descriptor for the message or enum with that name.

func (*FileDescriptorSetParser) TypeName Uses

func (g *FileDescriptorSetParser) TypeName(obj Object) string

TypeName returns a full name for the underlying Object type.

func (*FileDescriptorSetParser) WrapTypes Uses

func (g *FileDescriptorSetParser) WrapTypes(fds *descriptor.FileDescriptorSet)

WrapTypes creates wrapper types for messages, enumse and file inside the FileDescriptorSet.

type Object Uses

type Object interface {
    PackageName() string // The name we use in our output (a_b_c), possibly renamed for uniqueness.
    TypeName() []string
    File() *descriptor.FileDescriptorProto
}

Object is a shared interface implemented by EnumDescriptor and Descriptor

Package descriptor imports 7 packages (graph) and is imported by 2 packages. Updated 2018-09-28. Refresh now. Tools for package owners.