Documentation ¶
Index ¶
- Constants
- func EntryPointPackageName(filename string) (string, error)
- func GetDependencies(entryPoint string) ([]string, error)
- func GetDependenciesAstFiles(filename string) ([]*ast.File, error)
- type Arg
- type DefaultValue
- type Method
- type PackageInfo
- type Property
- type Return
- type SMDError
- type SMDReturn
- type SMDType
- type Service
- type Struct
Constants ¶
View Source
const (
GenerateFileSuffix = "_zenrpc.go"
)
Variables ¶
This section is empty.
Functions ¶
func EntryPointPackageName ¶
func GetDependencies ¶
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 { EntryPoint string 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 PackageNamesAndAliasesUsedInServices map[string]struct{} // set of structs names from arguments for printing imports ImportsIncludedToGeneratedCode []*ast.ImportSpec }
PackageInfo represents struct info for XXX_zenrpc.go file generation
func NewPackageInfo ¶
func NewPackageInfo(filename string) (*PackageInfo, error)
func (PackageInfo) OutputFilename ¶
func (pi PackageInfo) OutputFilename() string
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.