ast

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inspect

func Inspect(node Node, f func(Node) bool)

Inspect traverses an AST in depth-first order: It starts by calling f(node); node must not be nil. If f returns true, Inspect invokes f recursively for each of the non-nil children of node, followed by a call of f(nil).

func Walk

func Walk(v Visitor, node Node)

Walk ..

Types

type HTTPOptions

type HTTPOptions struct {
	Node
	Method       string
	Path         string
	Body         string
	ResponseBody string
	Additional   []*HTTPOptions
}

HTTPOptions 表示HTTP选项

type Node

type Node interface {
}

Node ..

type ProtobufField

type ProtobufField struct {
	Node
	Type string
	Name string
	Tag  string
}

ProtobufField 表示protobuf字段

type ProtobufFile

type ProtobufFile struct {
	Node
	Filename  string
	Syntax    string
	Package   string
	GoPackage string
	Imports   []string
	Services  []*ProtobufService
	Messages  []*ProtobufMessage
}

ProtobufFile 表示一个protobuf文件

type ProtobufMessage

type ProtobufMessage struct {
	Node
	Name   string
	Fields []*ProtobufField
}

ProtobufMessage 表示protobuf消息

type ProtobufRPC

type ProtobufRPC struct {
	Node
	Name        string
	Request     string
	Response    string
	LineNum     int
	HTTPOptions *HTTPOptions
}

ProtobufRPC 表示protobuf RPC方法

type ProtobufService

type ProtobufService struct {
	Node
	Name string
	RPCs []*ProtobufRPC
}

ProtobufService 表示protobuf服务

type RPC

type RPC struct {
	Node
	Routes   []*Route
	Handler  string
	Request  string
	Response string
}

RPC ..

type Route

type Route struct {
	Node
	Methods []string
	URI     string
}

Route ..

type Service

type Service struct {
	Node
	Name string
	Rpcs []*RPC
}

Service ..

type Stmt

type Stmt struct {
	Node
	Services []*Service
}

Stmt ..

type Visitor

type Visitor interface {
	Visit(node Node) (w Visitor)
}

Visitor ..

Jump to

Keyboard shortcuts

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