Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader struct {
// Protoc specifies the path to the `protoc` executable. If empty, the Loader
// attempts to execute protoc via PATH.
Protoc string
// ImportPaths includes any extra -I (or --proto_path) flags to the protoc
// execution required to resolve all proto dependencies.
ImportPaths []string
// BiDirectional specifies whether or not the AST should be resolved with
// bidirectional AST resolution.
BiDirectional bool
// FS overrides the file system used by the Loader. FS must be nil or an
// instance of *afero.OsFs if LoadProtos is called.
FS afero.Fs
}
Loader is a testing utility that can resolve an AST in a variety of manners. The loader can be used to provide entities to test functions.
func (Loader) LoadFDSet ¶
LoadFDSet resolves an AST from a serialized FileDescriptorSet file path on l.FS. The test/benchmark is fatally stopped if there is any error.
func (Loader) LoadFDSetReader ¶
LoadFDSetReader resolve an AST from a serialized FileDescriptorSet in r. The test/benchmark is fatally stopped if there is any error.
func (Loader) LoadProtos ¶
LoadProtos executes protoc against the provided files (or globs, as defined by filepath.Glob), returning a resolved pgs.AST. The test/benchmark is fatally stopped if there is any error.
This function requires the Loader's FS field to be nil or an instance of *afero.OsFs, otherwise, t will be immediately failed.