thriftfile

package
v0.0.0-...-0cf5105 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package thriftfile implements a parser for .thrift files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Name  *Ident
	Value *String // may be nil
	// contains filtered or unexported fields
}

An Annotation represents an annotation.

type AnnotationList

type AnnotationList struct {
	List []*Annotation
	// contains filtered or unexported fields
}

An AnnotationList node represents a list of annotations enclosed by parentheses.

type BadDef

type BadDef struct {
	From, To gotoken.Pos
	// contains filtered or unexported fields
}

A BadDef node is a placeholder for a definition containing syntax errors for which a correct definition node cannot be created.

type Const

type Const struct {
	Type  Type
	Name  *Ident
	Value Value
	// contains filtered or unexported fields
}

A Const node represents a constant definition.

type Def

type Def interface {
	Node
	// contains filtered or unexported methods
}

A Def represents a definition node.

type Enum

type Enum struct {
	Name        *Ident
	Values      *EnumValueList
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

An Enum node represents an enum definition.

type EnumValue

type EnumValue struct {
	Name        *Ident
	Value       *Int            // may be nil
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

An EnumValue node represents an enum value definition.

type EnumValueList

type EnumValueList struct {
	List []*EnumValue
	// contains filtered or unexported fields
}

An EnumValueList node represents a list of enum value definitions enclosed by curly braces.

type Field

type Field struct {
	ID          *Int // may be nil
	Required    bool
	Optional    bool
	Type        Type
	Reference   bool
	Name        *Ident
	Default     Value           // may be nil
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

A Field node represents a field definition.

type FieldList

type FieldList struct {
	List []*Field
	// contains filtered or unexported fields
}

A FieldList node represents a list of field definitions enclosed by curly braces or parentheses.

type File

type File struct {
	Headers []Header
	Defs    []Def
	// contains filtered or unexported fields
}

A File node represents a .thrift file.

func Parse

func Parse(fset *gotoken.FileSet, filename string, src []byte) (f *File, err error)

Parse parses a .thrift file.

type Float

type Float struct {
	Value string
	// contains filtered or unexported fields
}

A Float node represents a floating-point literal.

type Header interface {
	Node
	// contains filtered or unexported methods
}

A Header represents a header node.

type Ident

type Ident struct {
	Name string
	// contains filtered or unexported fields
}

An Ident node represents an identifier.

type Include

type Include struct {
	Path *String
	// contains filtered or unexported fields
}

An Include node represents an include header.

type Int

type Int struct {
	Value string
	// contains filtered or unexported fields
}

An Int node represents an integer literal.

type KeyValuePair

type KeyValuePair struct {
	Key, Value Value
	// contains filtered or unexported fields
}

A KeyValuePair node represents a key-value pair.

type KeyValuePairList

type KeyValuePairList struct {
	List []*KeyValuePair
	// contains filtered or unexported fields
}

A KeyValuePairList node represents a list of key-value pairs enclosed by curly braces.

type List

type List struct {
	Element     Type
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

A List node represents a list type.

type Map

type Map struct {
	Key         Type
	Value       Type
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

A Map node represents a map type.

type Method

type Method struct {
	OneWay      bool
	Void        bool
	Return      Type // may be nil
	Name        *Ident
	Arguments   *FieldList
	Throws      *FieldList      // may be nil
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

A Method node represents a method definition.

type MethodList

type MethodList struct {
	List []*Method
	// contains filtered or unexported fields
}

A MethodList node represents a list of method definitions enclosed by curly braces.

type Namespace

type Namespace struct {
	Scope       *Ident // nil means all scopes
	Name        *Ident
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

A Namespace node represents a namespace header.

type Node

type Node interface {
	// contains filtered or unexported methods
}

A Node represents a syntax tree node.

type Service

type Service struct {
	Name        *Ident
	Extends     *Ident // may be nil
	Methods     *MethodList
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

A Service node represents a service definition.

type Set

type Set struct {
	Element     Type
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

A Set node represents a set type.

type String

type String struct {
	Value string
	// contains filtered or unexported fields
}

A String node represents a string literal.

type Struct

type Struct struct {
	Union       bool
	Exception   bool
	Name        *Ident
	Fields      *FieldList
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

A Struct node represents a struct-like definition.

type Type

type Type interface {
	Node
	// contains filtered or unexported methods
}

A Type represents a type node.

type TypeRef

type TypeRef struct {
	Name        *Ident
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

A TypeRef node represents a type reference.

type Typedef

type Typedef struct {
	Type        Type
	Name        *Ident
	Annotations *AnnotationList // may be nil
	// contains filtered or unexported fields
}

A Typedef node represents a type definition.

type Value

type Value interface {
	Node
	// contains filtered or unexported methods
}

A Value represents a value node.

type ValueList

type ValueList struct {
	List []Value
	// contains filtered or unexported fields
}

A ValueList node represents a list of values enclosed by square brackets.

Jump to

Keyboard shortcuts

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