Documentation ¶
Index ¶
- Constants
- Variables
- func Close() error
- func DisableOp()
- func EnableOp()
- func FieldByIndexOfValue(v reflect.Value, idx []int) reflect.Value
- func FieldByNameOfValue(v reflect.Value, vname, fname string, s *Session) reflect.Value
- func FieldsOfType(t reflect.Type) []reflect.StructField
- func FieldsOfValue(v reflect.Value) []reflect.Value
- func FindValue(name string) reflect.Value
- func FullNameOfType(t reflect.Type) string
- func FullNameOfValue(v reflect.Value) string
- func IsRunning() bool
- func MethodsOfType(t reflect.Type) []reflect.Method
- func MethodsOfValue(v reflect.Value) []reflect.Value
- func RandomString(n int) string
- func RegisteOpHandler(op string, h Handler)
- func RegisteThreadSafeSandbox(sb ThreadSafeSandBox)
- func RegisteType(ud interface{})
- func RegisteValue(name string, ud interface{})
- func SetBool(v reflect.Value, x bool) bool
- func SetBytes(v reflect.Value, x []byte) bool
- func SetComplex(v reflect.Value, x complex128) bool
- func SetDebug(debug bool)
- func SetFloat(v reflect.Value, x float64) bool
- func SetInt(v reflect.Value, x int64) bool
- func SetLogger(logger log_Logger)
- func SetPointer(v reflect.Value, x unsafe.Pointer) bool
- func SetSession(s *Session)
- func SetString(v reflect.Value, x string) bool
- func SetUint(v reflect.Value, x uint64) bool
- func Startup(cfg Config) error
- func Types() map[string]reflect.Type
- func TypesByNameFunc(match func(string) bool) map[string]reflect.Type
- func UnregisteValue(name string, ud interface{})
- func UnsafeSetBool(v reflect.Value, x bool) bool
- func UnsafeSetBytes(v reflect.Value, x []byte) bool
- func UnsafeSetComplex(v reflect.Value, x complex128) bool
- func UnsafeSetFloat(v reflect.Value, x float64) bool
- func UnsafeSetInt(v reflect.Value, x int64) bool
- func UnsafeSetPointer(v reflect.Value, x uintptr) bool
- func UnsafeSetString(v reflect.Value, x string) bool
- func UnsafeSetUint(v reflect.Value, x uint64) bool
- func Values() map[string]reflect.Value
- func ValuesByNameFunc(match func(string) bool) map[string]reflect.Value
- type ApiResult
- type Config
- type FieldTypeDesc
- type FieldValueDesc
- type Handler
- type HandlerWrapper
- type InvokeResult
- type MapDesc
- type MethodDesc
- type MethodParam
- type OpEvent
- type Session
- type SliceDesc
- type Test
- type TestNest
- type ThreadSafeSandBox
- type TypeDesc
- type ValueDesc
Constants ¶
View Source
const ( Tag_OK = 0 Tag_ParamIllegal = 1 Tag_AuthFailed = 2 Tag_AuthNeed = 3 Tag_AccessDenied = 4 Tag_ProcessTimeout = 5 Tag_NoFindValue = 6 Tag_NoFindField = 7 Tag_MapInvalid = 8 Tag_NoMoreData = 9 Tag_SliceIsNil = 10 Tag_NoFindMethod = 11 Tag_OpDisable = 12 Tag_InternalException = 13 )
View Source
const (
SESSION_AUTH_IP = "_$IP$_"
)
Variables ¶
View Source
var SessionMgr cache.Cache
Functions ¶
func FieldByNameOfValue ¶
func FieldsOfType ¶
func FieldsOfType(t reflect.Type) []reflect.StructField
func FullNameOfType ¶
func FullNameOfValue ¶
func RandomString ¶
RandomString returns a random string with a fixed length
func RegisteOpHandler ¶
func RegisteThreadSafeSandbox ¶
func RegisteThreadSafeSandbox(sb ThreadSafeSandBox)
func RegisteType ¶
func RegisteType(ud interface{})
func RegisteValue ¶
func RegisteValue(name string, ud interface{})
func SetComplex ¶
func SetComplex(v reflect.Value, x complex128) bool
func SetDebug ¶
func SetDebug(debug bool)
Enable the delivery of debug messages to the logger. Only meaningful if a logger is also set.
func SetLogger ¶
func SetLogger(logger log_Logger)
Specify the *log.Logger object where log messages should be sent to.
func SetSession ¶
func SetSession(s *Session)
func UnregisteValue ¶
func UnregisteValue(name string, ud interface{})
func UnsafeSetComplex ¶
func UnsafeSetComplex(v reflect.Value, x complex128) bool
Types ¶
type Config ¶
type Config struct { Addr string //gmx api地址 Username string //gmx 交互用的用户名 Password string //gmx 交互用的密码 SessionLifeTime int //gmx session生命周期,单位:秒 Timeout int //gmx api超时时间,单位:秒 WhiteAddr []string //gmx api交互白名单地址 Debug bool //gmx debug模式,log开关 EnableOp bool //gmx api交互开关 }
var Cfg Config
type FieldTypeDesc ¶
type FieldTypeDesc struct { Name string `json:"name"` Type string `json:"type"` Kind uint `json:"kind"` Tag string `json:"tag"` Offset int `json:"offset"` Index []int `json:"index"` Anonymous bool `json:"anonymous"` IsExported bool `json:"isexported"` }
Class = {"name":"xxx", "type":"string"},{"name":"yyy", "type":"int"}
type FieldValueDesc ¶
type FieldValueDesc struct { FieldTypeDesc Value interface{} `json:"value"` }
type Handler ¶
func GetOpHandler ¶
type HandlerWrapper ¶
func (HandlerWrapper) Serve ¶
func (hw HandlerWrapper) Serve(event *OpEvent) *ApiResult
type InvokeResult ¶
type MethodDesc ¶
type MethodDesc struct { Name string `json:"name"` Index int `json:"index"` RcvrIsPtr bool `json:"rcvrisptr"` In []MethodParam `json:"in"` Out []MethodParam `json:"out"` }
type MethodParam ¶
type TestNest ¶
type TestNest struct { I int I8 int8 I16 int16 I32 int32 I64 int64 U uint U8 uint8 U16 uint16 U32 uint32 U64 uint64 F32 float32 F64 float64 Str string // contains filtered or unexported fields }
func NewTestNest ¶
func NewTestNest() *TestNest
type TypeDesc ¶
type TypeDesc struct { Name string `json:"name"` Type string `json:"type"` IsExported bool `json:"isexported"` Fields []FieldTypeDesc `json:"fields"` Methods []MethodDesc `json:"methods"` }
Classes = [{"name":"xxx", "type":"string"},{"name":"yyy", "type":"int"}]
func MetaOfType ¶
type ValueDesc ¶
type ValueDesc struct { Name string `json:"name"` Type string `json:"type"` Kind uint `json:"kind"` CanSet bool `json:"canset"` Value interface{} `json:"value"` Fields []FieldValueDesc `json:"fields"` Methods []MethodDesc `json:"methods"` }
func DescOfValue ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.