Documentation
¶
Overview ¶
*
- generate a key for any value.
- Rosbit Xu <me@rosbit.cn>
- Oct. 28, 2018
Index ¶
- type JsContext
- func (ctx *JsContext) BindFunc(funcName string, funcVarPtr interface{}) (err error)
- func (ctx *JsContext) BindFuncs(funcName2FuncVarPtr map[string]interface{}) (err error)
- func (ctx *JsContext) Eval(script string, env map[string]interface{}) (res interface{}, err error)
- func (ctx *JsContext) EvalFile(scriptFile string, env map[string]interface{}) (res interface{}, err error)
- func (ctx *JsContext) Free()
- func (ctx *JsContext) GetGlobal(name string) (res interface{}, err error)
- type V2KPool
- type Val2KeyFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsContext ¶
func NewContext ¶
func (*JsContext) BindFunc ¶
bind a var of golang func with a JS function name, so calling JS function is just calling the related golang func. @param funcVarPtr in format `var funcVar func(....) ...; funcVarPtr = &funcVar`
type V2KPool ¶ added in v0.1.2
type V2KPool struct {
// contains filtered or unexported fields
}
func NewV2KPool ¶ added in v0.1.2
func NewV2KPool(val2key Val2KeyFunc, valHashable bool) *V2KPool
type Val2KeyFunc ¶ added in v0.1.2
type Val2KeyFunc func(val interface{}) (interface{}, error) // different val mapped to different key
Click to show internal directories.
Click to hide internal directories.