parser

package
v1.0.12-0...-16f252f Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAstParser

func NewAstParser(golang []byte, filterStruct map[string]lang.PlaceholderType, log console.Console) *astParser

Types

type Field

type Field struct {
	Name     stringx.String
	TypeName string
	JsonTag  string
	Document []string
	Comment  []string
}

type Func

type Func struct {
	Name        stringx.String
	InType      string
	InTypeName  string // remove *Context,such as LoginRequest、UserRequest
	OutTypeName string // remove *Context
	OutType     string
	Document    []string
}

type PbAst

type PbAst struct {
	Package string
	// external reference
	Imports map[string]string
	Strcuts map[string]*Struct
	// rpc server's functions,not all functions
	Service []*RpcService
}

parsing for rpc

func (*PbAst) GenTypesCode

func (a *PbAst) GenTypesCode() (string, error)

type RpcService

type RpcService struct {
	Name  stringx.String
	Funcs []*Func
}

type Struct

type Struct struct {
	Name     stringx.String
	Document []string
	Comment  []string
	Field    []*Field
}

Jump to

Keyboard shortcuts

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