package protobuf
import "cuelang.org/go/internal/protobuf"
Package protobuf defines functionality for parsing protocol buffer definitions and instances.
TODO: this package can become public once we have found a good nest for it.
Index ¶
- func Parse(filename string, body io.Reader, c *Config) (f *ast.File, err error)
- type Config
- type Error
Functions ¶
func Parse ¶
Parse parses a single proto file and returns its contents translated to a CUE file. Imports are resolved using the path define in Config. If body is not nil, it will use this as the contents of the file. Otherwise Parse will open the given file name at the fully qualified path.
The following field options are supported:
(cue.val) string CUE constraint for this field. The string may refer to other fields in a message definition. (cue.opt) FieldOptions required bool Defines the field is required. Use with caution.
Types ¶
type Config ¶
type Config struct { Paths []string }
Config specifies the environment into which to parse a proto definition file.
type Error ¶
Error describes the location and cause of an error.
func (*Error) Error ¶
func (*Error) Unwrap ¶
Source Files ¶
parse.go protobuf.go types.go util.go
- Version
- v0.0.2
- Published
- Jun 22, 2019
- Platform
- windows/amd64
- Imports
- 13 packages
- Last checked
- 7 minutes ago –
Tools for package owners.