Documentation ¶
Index ¶
- func CheckEnvironments() (err error)
- func GenPbFile(pb *PbPackage) error
- func GenerateEditorconfig(pb *PbPackage) (err error)
- func GenerateMod(pb *PbPackage) (err error)
- func GenerateProto(pb *PbPackage) error
- func GetDefaultEditorconfig() []byte
- func InjectTagParseFile(inputPath string) ([]textArea, error)
- func InjectTagWriteFile(inputPath string, areas []textArea) error
- func ParseGoDir(dir string) (map[string]*GoPackage, error)
- type GoContext
- type GoFile
- type GoFunc
- type GoFuncCall
- type GoFuncCallArg
- type GoFuncNode
- type GoImport
- type GoPackage
- type GoParams
- type GoReturn
- type GoStruct
- type PbComment
- type PbCommentTag
- type PbEnum
- type PbEnumField
- type PbMapField
- type PbMessage
- type PbNormalField
- type PbOption
- type PbPackage
- func (p *PbPackage) GetMessageFullName(e *proto.Message) string
- func (p *PbPackage) GetParent(v proto.Visitee) string
- func (p *PbPackage) GoPackage() string
- func (p *PbPackage) ProjectRoot() string
- func (p *PbPackage) Proto() *proto.Proto
- func (p *PbPackage) ProtoFilePath() string
- func (p *PbPackage) Walk()
- type PbRPC
- type ProtoVisitor
- func (p *ProtoVisitor) VisitComment(e *proto.Comment)
- func (p *ProtoVisitor) VisitEnum(e *proto.Enum)
- func (p *ProtoVisitor) VisitEnumField(i *proto.EnumField)
- func (p *ProtoVisitor) VisitExtensions(e *proto.Extensions)
- func (p *ProtoVisitor) VisitGroup(g *proto.Group)
- func (p *ProtoVisitor) VisitImport(i *proto.Import)
- func (p *ProtoVisitor) VisitMapField(f *proto.MapField)
- func (p *ProtoVisitor) VisitMessage(m *proto.Message)
- func (p *ProtoVisitor) VisitNormalField(i *proto.NormalField)
- func (p *ProtoVisitor) VisitOneof(o *proto.Oneof)
- func (p *ProtoVisitor) VisitOneofField(o *proto.OneOfField)
- func (p *ProtoVisitor) VisitOption(o *proto.Option)
- func (p *ProtoVisitor) VisitOptions(o *proto.Option)
- func (p *ProtoVisitor) VisitPackage(pkg *proto.Package)
- func (p *ProtoVisitor) VisitProto(*proto.Proto)
- func (p *ProtoVisitor) VisitRPC(rpc *proto.RPC)
- func (p *ProtoVisitor) VisitReserved(rs *proto.Reserved)
- func (p *ProtoVisitor) VisitService(v *proto.Service)
- func (p *ProtoVisitor) VisitSyntax(s *proto.Syntax)
- type ScanErrCodeContext
- func (p *ScanErrCodeContext) GetErrListAndClear() []string
- func (p *ScanErrCodeContext) GetModList() []string
- func (p *ScanErrCodeContext) MergePkgMap(m map[string]*GoPackage)
- func (p *ScanErrCodeContext) MergePkgMapWithPkgName(m map[string]*GoPackage, pkg string)
- func (p *ScanErrCodeContext) Scan(mod, name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckEnvironments ¶
func CheckEnvironments() (err error)
func GenerateEditorconfig ¶
func GenerateMod ¶
func GenerateProto ¶
func GetDefaultEditorconfig ¶
func GetDefaultEditorconfig() []byte
func InjectTagParseFile ¶
func InjectTagWriteFile ¶
Types ¶
type GoContext ¶
type GoContext struct { GoPathList []string ModPath2RealPathMap map[string]string ModPath2ModNameMap map[string]string }
func (*GoContext) FindPackageName ¶
func (*GoContext) FindPackagePath ¶
type GoFile ¶
func ParseGoFile ¶
type GoFunc ¶
type GoFunc struct { Name string FuncCalls []*GoFuncCall Returns []*GoReturn Params []*GoParams // 接收类型,struct的类型 RecvType string }
func (*GoFunc) StringWithColor ¶
type GoFuncCall ¶
type GoFuncCall struct { Names []string Args []*GoFuncCallArg }
type GoFuncCallArg ¶
type GoFuncCallArg struct {
Names []string
}
type GoFuncNode ¶
type GoFuncNode struct {
// contains filtered or unexported fields
}
func (*GoFuncNode) GetFile ¶
func (g *GoFuncNode) GetFile() *GoFile
func (*GoFuncNode) GetFunc ¶
func (g *GoFuncNode) GetFunc() *GoFunc
type GoPackage ¶
type GoPackage struct { Name string FileMap map[string]*GoFile FuncMap map[string]*GoFuncNode }
func (*GoPackage) GetFunc ¶
func (p *GoPackage) GetFunc(name string) *GoFuncNode
type GoParams ¶
func (*GoParams) StringWithColor ¶
type PbComment ¶
type PbComment struct {
// contains filtered or unexported fields
}
func NewPbComment ¶
type PbCommentTag ¶
type PbCommentTag struct {
// contains filtered or unexported fields
}
func NewPbCommentTag ¶
func NewPbCommentTag(tag string) *PbCommentTag
func (*PbCommentTag) Lines ¶
func (p *PbCommentTag) Lines() []string
func (*PbCommentTag) Tag ¶
func (p *PbCommentTag) Tag() string
type PbEnumField ¶
type PbEnumField struct {
// contains filtered or unexported fields
}
func NewPbEnumField ¶
func NewPbEnumField(f *proto.EnumField) *PbEnumField
type PbMapField ¶
type PbMapField struct {
// contains filtered or unexported fields
}
func NewPbMapField ¶
func NewPbMapField(f *proto.MapField) *PbMapField
type PbMessage ¶
type PbMessage struct { Name string // contains filtered or unexported fields }
func NewPbMessage ¶
type PbNormalField ¶
type PbNormalField struct { Name string // contains filtered or unexported fields }
func NewPbNormalField ¶
func NewPbNormalField(f *proto.NormalField) *PbNormalField
func (*PbNormalField) Field ¶
func (p *PbNormalField) Field() *proto.NormalField
func (*PbNormalField) Type ¶
func (p *PbNormalField) Type() string
type PbOption ¶
func NewPbOption ¶
type PbPackage ¶
type PbPackage struct { RawGoPackage string PackageName string // contains filtered or unexported fields }
func ParseProto ¶
func (*PbPackage) GetMessageFullName ¶
func (*PbPackage) ProjectRoot ¶
func (*PbPackage) ProtoFilePath ¶
type ProtoVisitor ¶
type ProtoVisitor struct {
// contains filtered or unexported fields
}
func (*ProtoVisitor) VisitComment ¶
func (p *ProtoVisitor) VisitComment(e *proto.Comment)
func (*ProtoVisitor) VisitEnum ¶
func (p *ProtoVisitor) VisitEnum(e *proto.Enum)
func (*ProtoVisitor) VisitEnumField ¶
func (p *ProtoVisitor) VisitEnumField(i *proto.EnumField)
func (*ProtoVisitor) VisitExtensions ¶
func (p *ProtoVisitor) VisitExtensions(e *proto.Extensions)
func (*ProtoVisitor) VisitGroup ¶
func (p *ProtoVisitor) VisitGroup(g *proto.Group)
func (*ProtoVisitor) VisitImport ¶
func (p *ProtoVisitor) VisitImport(i *proto.Import)
func (*ProtoVisitor) VisitMapField ¶
func (p *ProtoVisitor) VisitMapField(f *proto.MapField)
func (*ProtoVisitor) VisitMessage ¶
func (p *ProtoVisitor) VisitMessage(m *proto.Message)
func (*ProtoVisitor) VisitNormalField ¶
func (p *ProtoVisitor) VisitNormalField(i *proto.NormalField)
func (*ProtoVisitor) VisitOneof ¶
func (p *ProtoVisitor) VisitOneof(o *proto.Oneof)
func (*ProtoVisitor) VisitOneofField ¶
func (p *ProtoVisitor) VisitOneofField(o *proto.OneOfField)
func (*ProtoVisitor) VisitOption ¶
func (p *ProtoVisitor) VisitOption(o *proto.Option)
func (*ProtoVisitor) VisitOptions ¶
func (p *ProtoVisitor) VisitOptions(o *proto.Option)
func (*ProtoVisitor) VisitPackage ¶
func (p *ProtoVisitor) VisitPackage(pkg *proto.Package)
func (*ProtoVisitor) VisitProto ¶
func (p *ProtoVisitor) VisitProto(*proto.Proto)
func (*ProtoVisitor) VisitRPC ¶
func (p *ProtoVisitor) VisitRPC(rpc *proto.RPC)
func (*ProtoVisitor) VisitReserved ¶
func (p *ProtoVisitor) VisitReserved(rs *proto.Reserved)
func (*ProtoVisitor) VisitService ¶
func (p *ProtoVisitor) VisitService(v *proto.Service)
func (*ProtoVisitor) VisitSyntax ¶
func (p *ProtoVisitor) VisitSyntax(s *proto.Syntax)
type ScanErrCodeContext ¶
type ScanErrCodeContext struct {
// contains filtered or unexported fields
}
func NewScanErrCodeContext ¶
func NewScanErrCodeContext() *ScanErrCodeContext
func (*ScanErrCodeContext) GetErrListAndClear ¶
func (p *ScanErrCodeContext) GetErrListAndClear() []string
func (*ScanErrCodeContext) GetModList ¶
func (p *ScanErrCodeContext) GetModList() []string
func (*ScanErrCodeContext) MergePkgMap ¶
func (p *ScanErrCodeContext) MergePkgMap(m map[string]*GoPackage)
func (*ScanErrCodeContext) MergePkgMapWithPkgName ¶
func (p *ScanErrCodeContext) MergePkgMapWithPkgName(m map[string]*GoPackage, pkg string)
func (*ScanErrCodeContext) Scan ¶
func (p *ScanErrCodeContext) Scan(mod, name string)
Click to show internal directories.
Click to hide internal directories.