Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PluginLoader ¶
func NewPluginLoader ¶
func NewPluginLoader(pathName string) (*PluginLoader, error)
NewPluginLoader create a loader
func (*PluginLoader) Call ¶
func (p *PluginLoader) Call(funcName string, p0 ...interface{}) (interface{}, error)
Call return type must be: (res,error)
func (*PluginLoader) CallValue ¶
func (p *PluginLoader) CallValue(funcName string, p0 ...interface{}) ([]reflect.Value, error)
CallValue Allow any number of return values,return type: []reflect.Value,error
func (*PluginLoader) MakeFunc ¶
func (s *PluginLoader) MakeFunc(fptr interface{}, name string) error
MakeFunc point a func ptr to plugin
type UnknownObject ¶
UnknownObject field 'V' MUST be valueof object type *struct{...} 成员'V' 必须是结构体指针的 Value: *struct{...}
func NewUnknownObject ¶
func NewUnknownObject(v reflect.Value) *UnknownObject
NewUnknownObject parameter 'v' MUST be valueof object type *struct{...}, or it will return nil 参数'v' 必须是结构体指针的 Value: *struct{...}, 否则返回 nil
func NewUnknownObjectFromInterface ¶ added in v1.0.11
func NewUnknownObjectFromInterface(p interface{}) *UnknownObject
NewUnknownObjectFromInterface parameter 'p' MUST be pointer of struct type, or it will return nil 参数'p' 必须是结构体指针, 否则返回 nil
func (*UnknownObject) Call ¶
func (s *UnknownObject) Call(fn string, args ...interface{}) []reflect.Value
Call 运行结构体的 method call the method of the struct
func (*UnknownObject) CopyToStruct ¶
func (s *UnknownObject) CopyToStruct(v interface{}) error
CopyToStruct 利用 reflect 技术把结构体的可 export 值复制到 v 中,v 必须是相似结构体的指针。 copy the exported value of a struct to v through gob encoding.
func (*UnknownObject) Get ¶
func (s *UnknownObject) Get(name string) reflect.Value
Get 得到结构体成员的 Value get the value of a field
func (*UnknownObject) Json ¶
func (s *UnknownObject) Json() []byte
Json 把结构体编码为 JSON。 convert the struct to JSON. if error,return nil.