extract

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	*descriptor.FieldDescriptorProto

	FullyQualifiedPath  string
	DescriptorProto     *descriptor.DescriptorProto
	FileDescriptorProto *descriptor.FileDescriptorProto
	FileDescriptorSet   *descriptor.FileDescriptorSet
}

Field is an extracted field.

type Getter

type Getter interface {
	// Get the field that matches the path.
	GetField(fileDescriptorSets []*descriptor.FileDescriptorSet, path string) (*Field, error)
	// Get the message that matches the path.
	GetMessage(fileDescriptorSets []*descriptor.FileDescriptorSet, path string) (*Message, error)
	// Get the service that matches the path.
	GetService(fileDescriptorSets []*descriptor.FileDescriptorSet, path string) (*Service, error)
}

Getter extracts elements.

Paths can begin with ".". The first FileDescriptorSet with a match will be returned.

func NewGetter

func NewGetter(options ...GetterOption) Getter

NewGetter returns a new Getter.

type GetterOption

type GetterOption func(*getter)

GetterOption is an option for a new Getter.

func GetterWithLogger

func GetterWithLogger(logger *zap.Logger) GetterOption

GetterWithLogger returns a GetterOption that uses the given logger.

The default is to use zap.NewNop().

type Message

type Message struct {
	*descriptor.DescriptorProto

	FullyQualifiedPath  string
	FileDescriptorProto *descriptor.FileDescriptorProto
	FileDescriptorSet   *descriptor.FileDescriptorSet
}

Message is an extracted message.

type Service

type Service struct {
	*descriptor.ServiceDescriptorProto

	FullyQualifiedPath  string
	FileDescriptorProto *descriptor.FileDescriptorProto
	FileDescriptorSet   *descriptor.FileDescriptorSet
}

Service is an extracted service.

Jump to

Keyboard shortcuts

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