protoast

package
v1.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAPIOptions

func ExtractAPIOptions(meth *descriptorpb.MethodDescriptorProto) (*options.HttpRule, error)

Extract the google.api.http option more details here vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go

Types

type ApiOptionInfo

type ApiOptionInfo struct {
	Info       *descriptorpb.SourceCodeInfo_Location
	ApiOptions *options.HttpRule
}

type EnumInfo added in v1.33.0

type EnumInfo struct {
	Name       string
	Info       *descriptorpb.SourceCodeInfo_Location
	ValuesInfo []ValueInfo
	AllowAlias bool
	Message    descriptorpb.DescriptorProto
}

type MessageInfo

type MessageInfo struct {
	Name       string
	Info       *descriptorpb.SourceCodeInfo_Location
	FieldInfos []FieldInfo
	Message    descriptorpb.DescriptorProto
}

type MethodInfo

type MethodInfo struct {
	Name     string
	Info     *descriptorpb.SourceCodeInfo_Location
	Method   *descriptorpb.MethodDescriptorProto
	Service  *descriptorpb.ServiceDescriptorProto // link the parent service
	HttpRule *ApiOptionInfo
}

type ProtoAST

type ProtoAST struct {
	Request          *pluginpb.CodeGeneratorRequest
	Response         *pluginpb.CodeGeneratorResponse
	Parameters       map[string]string
	ProtoMap         map[string]*descriptorpb.FileDescriptorProto
	FileProtoMap     map[string]*descriptorpb.FileDescriptorProto
	ProtoMapLocation map[string]*descriptorpb.SourceCodeInfo_Location
}

func NewProtoAST

func NewProtoAST(request *pluginpb.CodeGeneratorRequest) *ProtoAST

func (*ProtoAST) BuildMap

func (a *ProtoAST) BuildMap()

build a map of all protos

func (*ProtoAST) GetParameter

func (a *ProtoAST) GetParameter(parameter string) (value string, found bool)

Get a prameter from the used command

type ServiceInfo

type ServiceInfo struct {
	Name    string
	Info    *descriptorpb.SourceCodeInfo_Location
	Service *descriptorpb.ServiceDescriptorProto
	Methods []MethodInfo
}

type SourceInfo

type SourceInfo struct {
	Messages    []MessageInfo
	Enums       []EnumInfo
	InlineEnums []EnumInfo
	Services    []ServiceInfo
}

func GetSourceInfo

func GetSourceInfo(descr *descriptorpb.FileDescriptorProto) SourceInfo

type ValueInfo added in v1.33.0

type ValueInfo struct {
	Name  string
	Value int32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL