Documentation ¶
Index ¶
- Constants
- Variables
- func GetInvokeJsonProxyPtr() uintptr
- func Invoke(method string, args []interface{}, kwargs map[string]interface{}) (result_json string)
- func InvokeJson(method, args_json, kwargs_json string) (result_json string)
- func JSONError(err error) string
- func RegisterPlugin(plugin Plugin)
- func ResetPlugin()
- type MethodArgs
- func (p *MethodArgs) Arg(i int) interface{}
- func (p *MethodArgs) FloatArg(i int) float64
- func (p *MethodArgs) FloatKwArg(name string) float64
- func (p *MethodArgs) IntArg(i int) int64
- func (p *MethodArgs) IntKwArg(name string) int64
- func (p *MethodArgs) KwArg(name string) interface{}
- func (p *MethodArgs) StrArg(i int) string
- func (p *MethodArgs) StrKwArg(name string) string
- type MethodResult
- type MethodSpec
- type MethodType
- type PanicInfo
- type Plugin
Constants ¶
View Source
const CgoEnabled = true
Variables ¶
View Source
var DebugMode = false
Debug flag for kcl-plugin
Functions ¶
func GetInvokeJsonProxyPtr ¶
func GetInvokeJsonProxyPtr() uintptr
func InvokeJson ¶
Types ¶
type MethodArgs ¶
type MethodArgs struct { Args []interface{} KwArgs map[string]interface{} }
plugin method args
func ParseMethodArgs ¶
func ParseMethodArgs(args_json, kwargs_json string) (*MethodArgs, error)
func (*MethodArgs) Arg ¶
func (p *MethodArgs) Arg(i int) interface{}
func (*MethodArgs) FloatArg ¶
func (p *MethodArgs) FloatArg(i int) float64
func (*MethodArgs) FloatKwArg ¶
func (p *MethodArgs) FloatKwArg(name string) float64
func (*MethodArgs) IntArg ¶
func (p *MethodArgs) IntArg(i int) int64
func (*MethodArgs) IntKwArg ¶
func (p *MethodArgs) IntKwArg(name string) int64
func (*MethodArgs) KwArg ¶
func (p *MethodArgs) KwArg(name string) interface{}
func (*MethodArgs) StrArg ¶
func (p *MethodArgs) StrArg(i int) string
func (*MethodArgs) StrKwArg ¶
func (p *MethodArgs) StrKwArg(name string) string
type MethodSpec ¶
type MethodSpec struct { Type *MethodType Body func(args *MethodArgs) (*MethodResult, error) }
KCL Plugin method spec
func GetMethodSpec ¶
func GetMethodSpec(methodName string) (method MethodSpec, ok bool)
GetMethodSpec get plugin method by name.
type MethodType ¶
KCL Plugin method type
type PanicInfo ¶
type PanicInfo struct { X__kcl_PanicInfo__ bool `json:"__kcl_PanicInfo__"` RustFile string `json:"rust_file,omitempty"` RustLine int `json:"rust_line,omitempty"` RustCol int `json:"rust_col,omitempty"` KclPkgPath string `json:"kcl_pkgpath,omitempty"` KclFile string `json:"kcl_file,omitempty"` KclLine int `json:"kcl_line,omitempty"` KclCol int `json:"kcl_col,omitempty"` KclArgMsg string `json:"kcl_arg_msg,omitempty"` // only for schema check KclConfigMetaFile string `json:"kcl_config_meta_file,omitempty"` KclConfigMetaLine int `json:"kcl_config_meta_line,omitempty"` KclConfigMetaCol int `json:"kcl_config_meta_col,omitempty"` KclConfigMetaArgMsg string `json:"kcl_config_meta_arg_msg,omitempty"` Message string `json:"message"` ErrTypeCode string `json:"err_type_code,omitempty"` IsWarning string `json:"is_warning,omitempty"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.