driver

package
v0.0.0-...-5599ccc Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	DriverOptions
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(workspaceFolder string, opts ...DriverOption) *Driver

func (*Driver) Compile

func (d *Driver) Compile(protos []string) (*Results, error)

type DriverOption

type DriverOption func(*DriverOptions)

func WithRenameStrategy

func WithRenameStrategy(renameStrategy RenameStrategy) DriverOption

type DriverOptions

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

type RenameStrategy

type RenameStrategy int
const (
	KeepLSPResolvedNames RenameStrategy = iota

	// If set, this will restore the original names of the files that were
	// synthesized from external (previously generated) Go module sources.
	// This can be necessary if those dependencies are intended to be linked
	// into a binary alongside newly generated code containing references to
	// the LSP-resolved names for those files. Because the linked dependencies
	// will register their own file descriptors to the global file descriptor
	// cache using the original names at runtime, any workspace-local descriptor
	// protos must also refer to those dependencies with the expected runtime
	// names during code generation.
	// This only modifies the contents of AllDescriptorProtos and
	// WorkspaceLocalDescriptorProtos.
	RestoreExternalGoModuleDescriptorNames
)

type Results

type Results struct {
	Error                          bool
	Messages                       []string
	AllDescriptors                 []protoreflect.FileDescriptor
	AllDescriptorProtos            []*descriptorpb.FileDescriptorProto
	WorkspaceLocalDescriptors      []protoreflect.FileDescriptor
	WorkspaceLocalDescriptorProtos []*descriptorpb.FileDescriptorProto
	FileURIsByPath                 map[string]protocol.DocumentURI
	FilePathsByURI                 map[protocol.DocumentURI]string
}

Jump to

Keyboard shortcuts

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