astx

package
v0.0.0-...-fd45be6 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAstFile

func BuildAstFile(path string) (*ast.File, error)

Types

type Annotation

type Annotation struct {
	Pkg    string
	Name   string
	Values string // maybe json ?
}

type Ast

type Ast struct {
	Path       string
	Name       string
	Pkg        string
	Values     []*ValueSpec
	Structs    []*StructSpec
	Interfaces []*InterfaceSpec
	Funcs      []*FuncSpec
	Ast        *ast.File
}

func NewAst

func NewAst(path string) *Ast

type AstSpec

type AstSpec struct {
	ID      string
	Name    string
	PkgPath string
	Pkgs    []*PackageSpec
}

type Astx

type Astx struct {
	*loader.Package
	Path string
	Name string
	Pkg  string
	Ast  *ast.File
}

func NewAstx

func NewAstx(path string, lpkg *loader.Package) *Astx

type FieldSpec

type FieldSpec struct {
	Struct string
	Name   string
	Type   string
	Ptr    bool
	Tags   []*TagSpec
}

type FuncSpec

type FuncSpec struct {
	Pkg      string
	Name     string
	Comments []string
	Params   []*ParamSpec
	Returns  []*ReturnSpec
}

type InterfaceSpec

type InterfaceSpec struct {
	Pkg         string
	Name        string
	Type        token.Pos
	Comments    []string
	Methods     []*MethodSpec
	Annotations []*Annotation
}

type MethodSpec

type MethodSpec struct {
	Pkg      string
	Struct   string
	Name     string
	Comments []string
	Params   []*ParamSpec
	Returns  []*ReturnSpec
}

type PackageSpec

type PackageSpec struct {
	Pkg        string
	Alias      string
	Structs    []*StructSpec
	Interfaces []*InterfaceSpec
	Funcs      []*FuncSpec
}

type ParamSpec

type ParamSpec struct {
	Pkg      string
	FuncName string
	Name     string
	Ptr      bool
	Type     string
}

type ReturnSpec

type ReturnSpec struct {
	Pkg      string
	FuncName string
	Name     string
	Ptr      bool
	Type     string
}

type StructSpec

type StructSpec struct {
	Pkg         string
	Alias       string
	Name        string
	Type        token.Pos
	Comments    []string
	Fields      []*FieldSpec
	Methods     []*MethodSpec
	Annotations []*Annotation
}

type Tag

type Tag struct {
	Name  string
	Key   string
	Value string
}

type TagSpec

type TagSpec struct {
	Field string
	Tags  []*Tag
}

type Value

type Value struct {
	Composite bool
	Kind      token.Token
	Name      string
	Value     any
}

type ValueSpec

type ValueSpec struct {
	Pkg       string
	Tok       token.Token
	Composite bool
	Values    []Value
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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