package
3.2.0+incompatible
Repository: https://github.com/stackb/rules_proto.git
Documentation: pkg.go.dev
# Functions
Always is a file predicate function that always returns true.
DeduplicateAndSort removes duplicate entries and sorts the list.
FlatMapFiles is a utility function intended for use in computing a list of output files for a given proto_library.
ForIntent reduces a dict to a list by the given intent.
GetKeptFileRuleAttrString returns the value of the rule attribute IFF the backing File rule attribute has a '# keep' comment on it.
GetNamedOption returns the value of an option.
GetPackageConfig returns the associated package config.
GetPluginLabels returns the list of labels strings for a list of plugins.
GetPluginOptions returns the list of options by plugin.
GetPluginOuts returns the output location by plugin.
GlobalResolver returns a reference to the global ImportResolver.
GlobalRuleIndex returns a reference to the global RuleIndex.
GoPackageOption is a utility function to seek for the go_package option and split it.
GoPackagePath replaces dots with forward slashes.
HasMessageOrEnum is a file predicate function checks if any of the given file has a message or an enum.
HasMessagesOrEnums checks if any of the given files has a message or an enum.
HasService is a file predicate function that tests if any of the given file has a message or an enum.
HasServices checks if any of the given files has a service.
ImportPrefixRelativeFileNameWithExtensions returns a function that computes the name of a predicted generated file.
IsProtoFile returns true if the file extension looks like it should contain protobuf definitions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewFile takes the package directory and base name of the file (e.g.
No description provided by the author
NewLanguageRuleConfig returns a pointer to a new LanguageRule config with the 'Enabled' bit set to true.
NewOtherProtoLibrary constructs a new ProtoLibrary implementation.
NewPackage constructs a Package given a list of proto_library rules in the package.
NewPackageConfig initializes a new PackageConfig.
PackageFileNameWithExtensions returns a function that computes the name of a predicted generated file having the given extension(s).
No description provided by the author
ParseYConfigFile parses the given filename and returns a YConfig pointer or error if a file read or parse error occurs.
Plugins returns a reference to the global PluginRegistry.
ProtoLibraryImportSpecsForKind generates an ImportSpec for each file in the set of given proto_library.
ProtoLibraryImportSpecsForKind generates an ImportSpec for each file in the set of given proto_library.
No description provided by the author
No description provided by the author
RelativeFileNameWithExtensions returns a function that computes the name of a predicted generated file having the given extension(s) relative to the given dir.
ResolveDepsAttr returns a function that implements the DepsResolver interface.
ResolveFileRewrites takes a proto File object and returns a list of matching rewrites of the import statements.
ResolveImports is a utility function that returns a matching list of labels for the given import list.
ResolveImportsString is a utility function that returns a matching list of labels for the given import list.
ResolveLibraryRewrites takes a proto_library object and returns a list of matching rewrites of all the the transitive import statements.
ResolveRewrites takes a list of rewrite rules and returns the first match of the given input string.
Rules returns a reference to the global RuleRegistry.
StripRel removes the rel prefix from a filename (if has matching prefix).
ToPascalCase converts a string to PascalCase.
# Constants
LanguageDirective tells gazelle which languages a package should produce and how it is configured.
PluginDirective created an association between proto_lang and the label of a proto_plugin.
ProtoLibraryKey stores the ProtoLibrary implementation for a rule.
ResolveProvidesKey is the key expected to store a string slice that informs what imports a rule provides.
ResolverImpLangPrivateKey stores the implementation language override.
No description provided by the author
RuleDirective is the directive for toggling rule generation.
No description provided by the author
# Variables
No description provided by the author
ErrUnknownPlugin is the error returned when a plugin is not known.
ErrUnknownRule is the error returned when a rule is not known.
# Structs
File represents a proto file that is discovered in a package.
No description provided by the author
LanguageConfig carries a set of configured Plugins and Rules that will contribute to a protoc invocation.
LanguagePluginConfig associates metadata with a plugin implementation.
LanguageRuleConfig carries metadata about a rule and its dependencies.
OtherProtoLibrary implements the ProtoLibrary interface from an existing ProtoLibrary rule generated by an other extension (typically the bazel-gazelle/proto extension).
Package provides a set of proto_library derived rules for the package.
PackageConfig represents the config extension for the protobuf language.
PluginConfiguration represents the configuration of a protoc plugin and the sources & source mappings that are expected to be produced.
PluginContext represents the environment available to the plugin when invoked.
ProtocConfiguration represents the complete configuration and source mappings.
Rewrite is a replacement specification.
YConfig is used to configure a combined set of plugins, rules, and languages in a single YAML file.
YLanguage represents a LanguageConfig in YAML.
YPlugin represents a LanguagePluginConfig in YAML.
YRule represents a LanguageRuleConfig in YAML.
# Interfaces
FileVisitor is an optional interface for RuleProvider implementations.
ImportCrossResolver handles dependency resolution.
ImportProvider is an entity that can be queried for imported symbols by language name.
No description provided by the author
LanguageRule is capable of taking a compilation and deriving another rule based on it.
Plugin implementations are capable of predicting the sources that are generated by a particular protoc plugin.
PluginOptionsResolver is an optional interface that a plugin can implement.
PluginRegistry represents a library of plugin implementations.
ProtoLibrary represents a proto_library target and its associated parsed .proto files.
No description provided by the author
RuleProvider implementations are capable of providing a rule and import list to the gazelle GenerateArgs response.
RuleRegistry represents a library of rule implementations.
# Type aliases
No description provided by the author
Symbol is the type of a Starlark constructor symbol.