Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 2.8% on proxy.golang.org
Top 0.2% dependent packages on proxy.golang.org
Top 0.2% dependent repos on proxy.golang.org
Top 9.0% forks on proxy.golang.org
Top 0.1% docker downloads on proxy.golang.org

proxy.golang.org : github.com/bufbuild/protocompile

Package protocompile provides the entry point for a high performance native Go protobuf compiler. "Compile" in this case just means parsing and validating source and generating fully-linked descriptors in the end. Unlike the protoc command-line tool, this package does not try to use the descriptors to perform code generation. The various sub-packages represent the various compile phases and contain models for the intermediate results. Those phases follow: This package provides an easy-to-use interface that does all the relevant phases, based on the inputs given. If an input is provided as source, all phases apply. If an input is provided as a descriptor proto, only phases 3 to 5 apply. Nothing is necessary if provided a linked descriptor (which is usually only the case for select system dependencies). This package is also capable of taking advantage of multiple CPU cores, so a compilation involving thousands of files can be done very quickly by compiling things in parallel. A Resolver is how the compiler locates artifacts that are inputs to the compilation. For example, it can load protobuf source code that must be processed. A Resolver could also supply some already-compiled dependencies as fully-linked descriptors, alleviating the need to re-compile them. A Resolver can provide any of the following in response to a query for an input. Compilation will use the Resolver to load the files that are to be compiled and also to load all dependencies (i.e. other files imported by those being compiled). A Compiler accepts a list of file names and produces the list of descriptors. A Compiler has several fields that control how it works but only the Resolver field is required. A minimal Compiler, that resolves files by loading them from the file system based on the current working directory, can be had with the following simple snippet: This minimal Compiler will use default parallelism, equal to the number of CPU cores detected; it will not generate source code info in the resulting descriptors; and it will fail fast at the first sign of any error. All of these aspects can be customized by setting other fields.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/bufbuild/protocompile
Keywords: compiler, parser, protobuf, protocol-buffers
License: Apache-2.0
Latest release: 4 months ago
First release: over 1 year ago
Namespace: github.com/bufbuild
Dependent packages: 1,262
Dependent repositories: 1,311
Stars: 124 on GitHub
Forks: 4 on GitHub
Docker dependents: 218
Docker downloads: 1,128,357,446
See more repository details: repos.ecosyste.ms
Last synced: 6 days ago

    Loading...
    Readme
    Loading...