Documentation
¶
Index ¶
- func Gen(items []GenItem, allowPkgPath []string, outDir string) error
- type BField
- type BMethod
- func (m *BMethod) InDefine(i int) string
- func (m *BMethod) InLen() int
- func (m *BMethod) InParam() string
- func (m *BMethod) InType() string
- func (m *BMethod) OutCanNil(i int) bool
- func (m *BMethod) OutGet(i int) *BType
- func (m *BMethod) OutLen() int
- func (m *BMethod) OutRetArr() [][3]any
- func (m *BMethod) OutRetStr() string
- func (m *BMethod) OutType() string
- type BType
- type BindData
- func (b *BindData) AddBType(t *BType) (out *BType)
- func (b *BindData) AddInterface(t *Obj) (out *Obj)
- func (b *BindData) AddObj(t *Obj) (out *Obj)
- func (b *BindData) CopyBType(t *BType) (out *BType)
- func (b *BindData) GetBType(name, pkgPath string) (out *BType)
- func (b *BindData) GetObj(name, pkgPath string) (out *Obj)
- func (b *BindData) IsAllowPkgPath(path string) (out bool)
- func (b *BindData) Load() error
- func (b *BindData) LoadFunc(bObj *Obj, funcs [][2]any) error
- func (b *BindData) LoadFuncParam(ptp *BType) error
- func (b *BindData) LoadInterface(btp *BType) (*Obj, error)
- func (b *BindData) LoadObj(obj any) (*Obj, error)
- func (b *BindData) LoadType(tp reflect.Type, btpIn *BType) (btp *BType, ignore bool)
- type GenItem
- type Obj
- func (o *Obj) AddImport(path string)
- func (o *Obj) AddImportByField(fd *BField)
- func (o *Obj) FieldsBind() map[string][2]string
- func (o *Obj) FieldsBindFunc() [][3]any
- func (o *Obj) FieldsBindMap() [][3]any
- func (o *Obj) FieldsBindSlice() [][3]any
- func (o *Obj) GenImportPkg()
- func (o *Obj) LowerName() string
- func (o *Obj) UdName() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BMethod ¶
type BType ¶
type BType struct {
PkgPath string `json:"pkg_path"`
PkgName string `json:"pkg_name"`
Name string `json:"name"`
IsPtr bool `json:"is_ptr"`
IsBool bool `json:"is_bool"`
IsInt bool `json:"is_int"`
IsString bool `json:"is_string"`
IsFloat bool `json:"is_float"`
IsNumber bool `json:"is_number"`
IsStruct bool `json:"is_struct"`
IsSlice bool `json:"is_slice"`
IsArray bool `json:"is_array"`
ElemType *BType `json:"elem_type"`
IsMap bool `json:"is_map"`
ElemKeyType *BType `json:"elem_key_type"`
IsInterface bool `json:"is_interface"`
IsError bool `json:"is_error"`
IsAny bool `json:"is_any"`
IsFunc bool `json:"is_func"`
IsFuncValid bool `json:"is_func_valid"`
In []*BType `json:"in"`
Out []*BType `json:"out"`
RefType reflect.Type `json:"reflect_type"`
//for fields,methods in out, [1...]
Index int `json:"index"`
}
func (*BType) FuncDefine ¶
type BindData ¶
type BindData struct {
//out
AllType map[string]*BType `json:"all_type"` //tp.PkgPath()/Name
AllObj map[string]*Obj `json:"all_obj"` //tp.PkgPath()/Name
Objs []*Obj `json:"objs"`
//filter
AllInterface map[string]*BType `json:"interface"` //tp.PkgPath()/Name
InterfacePkgPath map[string]int `json:"interface_pkg_path"`
AllItf map[string]*Obj `json:"all_itf"` //tp.PkgPath()/Name
//in
AllowPkgPath map[string]int `json:"allow_pkg_path"`
Items []GenItem `json:"-"`
}
func NewBindData ¶
func (*BindData) AddInterface ¶
func (*BindData) IsAllowPkgPath ¶
func (*BindData) LoadFuncParam ¶
load func in out
func (*BindData) LoadInterface ¶
load interface
type Obj ¶
type Obj struct {
BType `json:"type"`
Fields []*BField `json:"fields"`
Methods []*BMethod `json:"methods"`
//global
Funcs []*BMethod `json:"funcs"`
//
Import map[string]int `json:"import"`
}
func (*Obj) AddImportByField ¶
func (*Obj) FieldsBindFunc ¶
func (*Obj) FieldsBindSlice ¶
Click to show internal directories.
Click to hide internal directories.