Version: v1.29.2 Latest Latest

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 4 Imported by: 9



Package idl provides a parser for Thrift IDL files.



This section is empty.


This section is empty.


func Parse

func Parse(s []byte) (*ast.Program, error)

Parse parses a Thrift document. If there is an error, it will be of type *ParseError.


type Config added in v1.28.0

type Config struct {
	// If Info is non-nil, it will be populated with information about the
	// parsed nodes.
	Info *Info

Config configures the Thrift IDL parser.

func (*Config) Parse added in v1.28.0

func (c *Config) Parse(s []byte) (*ast.Program, error)

Parse parses the given Thrift document.

type Error added in v1.28.0

type Error struct {
	Pos ast.Position
	Err error

Error holds an error and the position that caused it.

type Info added in v1.28.0

type Info struct {
	// contains filtered or unexported fields

Info contains additional information about the parsed document.

func (*Info) Pos added in v1.28.0

func (i *Info) Pos(n ast.Node) ast.Position

Pos returns a Node's position in the parsed document.

type ParseError added in v1.28.0

type ParseError struct{ Errors []Error }

ParseError is an error type listing parse errors and the positions that caused them.

func (*ParseError) Error added in v1.28.0

func (pe *ParseError) Error() string


Path Synopsis

Jump to

Keyboard shortcuts

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