Back to godoc.org

Package typemap

v0.3.3
Latest Go to latest

The latest major version is .

Published: Jan 20, 2020 | License: MIT | Module: github.com/bilibili/kratos

Index

type DefinitionComments

type DefinitionComments struct {
	Leading         string
	Trailing        string
	LeadingDetached []string
}

// ignored detached comments.

type MessageDefinition

type MessageDefinition struct {
	// Descriptor is is the DescriptorProto defining the message.
	Descriptor *descriptor.DescriptorProto
	// File is the File that the message was defined in. Or, if it has been
	// publicly imported, what File was that import performed in?
	File *descriptor.FileDescriptorProto
	// Parent is the parent message, if this was defined as a nested message. If
	// this was defiend at the top level, parent is nil.
	Parent *MessageDefinition
	// Comments describes the comments surrounding a message's definition. If it
	// was publicly imported, then these comments are from the actual source file,
	// not the file that the import was performed in.
	Comments DefinitionComments
	// contains filtered or unexported fields
}

MessageDefinition msg info

func (*MessageDefinition) Lineage

func (m *MessageDefinition) Lineage() []*MessageDefinition

Lineage returns m's parental chain all the way back up to a top-level message definition. The first element of the returned slice is the highest-level parent.

func (*MessageDefinition) ProtoName

func (m *MessageDefinition) ProtoName() string

ProtoName returns the dot-delimited, fully-qualified protobuf name of the message.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry is the place of descriptors resolving

func New

func New(files []*descriptor.FileDescriptorProto) *Registry

New Registry

func (*Registry) FieldComments

func (r *Registry) FieldComments(message *MessageDefinition, field *descriptor.FieldDescriptorProto) (DefinitionComments, error)

FieldComments ...

func (*Registry) FileComments

func (r *Registry) FileComments(file *descriptor.FileDescriptorProto) (DefinitionComments, error)

FileComments comment of file

func (*Registry) MessageDefinition

func (r *Registry) MessageDefinition(name string) *MessageDefinition

MessageDefinition by name

func (*Registry) MethodComments

func (r *Registry) MethodComments(file *descriptor.FileDescriptorProto, svc *descriptor.ServiceDescriptorProto, method *descriptor.MethodDescriptorProto) (DefinitionComments, error)

MethodComments comment of method

func (*Registry) MethodInputDefinition

func (r *Registry) MethodInputDefinition(method *descriptor.MethodDescriptorProto) *MessageDefinition

MethodInputDefinition returns MethodInputDefinition

func (*Registry) MethodOutputDefinition

func (r *Registry) MethodOutputDefinition(method *descriptor.MethodDescriptorProto) *MessageDefinition

MethodOutputDefinition returns MethodOutputDefinition

func (*Registry) ServiceComments

func (r *Registry) ServiceComments(file *descriptor.FileDescriptorProto, svc *descriptor.ServiceDescriptorProto) (DefinitionComments, error)

ServiceComments comments of service

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier