Documentation ¶
Index ¶
Constants ¶
View Source
const (
GenerateFileSuffix = "_zenrpc.go"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultValue ¶
type Method ¶
type Method struct { FuncDecl *ast.FuncType Name string LowerCaseName string HasContext bool Args []Arg DefaultValues map[string]DefaultValue Returns []Return SMDReturn *SMDReturn // return for generate smd schema; pointer for nil check Description string Errors []SMDError // errors for documentation in SMD }
type PackageInfo ¶
type PackageInfo struct { Dir string PackageName string Services []*Service Scopes map[string][]*ast.Scope // key - import name, value - array of scopes from each package file Structs map[string]*Struct Imports []*ast.ImportSpec StructsNamespacesFromArgs map[string]struct{} // set of structs names from arguments for printing imports ImportsForGeneration []*ast.ImportSpec }
PackageInfo represents struct info for XXX_zenrpc.go file generation
func NewPackageInfo ¶
func NewPackageInfo() *PackageInfo
func (*PackageInfo) Parse ¶
func (pi *PackageInfo) Parse(filename string) error
ParseFiles parse all files associated with package from original file
func (PackageInfo) String ¶
func (pi PackageInfo) String() string
type SMDType ¶
type SMDType struct { Type string ItemsType string // for array Ref string // for object and also if array item is object }
SMDType is a type representation for SMD generation
type Service ¶
func (Service) HasErrorVariable ¶
HasErrorVariable define adding err variable to generated Invoke function
Click to show internal directories.
Click to hide internal directories.