Versions in this module Expand all Collapse all v1 v1.2.1 Mar 15, 2020 Changes in this version + type App interface + AddRPCSerialize func(name string, Interface RPCSerialize) error + Configure func(settings conf.Config) error + GetModuleInited func() func(app App, module Module) + GetProcessID func() string + GetRPCSerialize func() map[string]RPCSerialize + GetRouteServer func(filter string, opts ...selector.SelectOption) (ServerSession, error) + GetServerById func(id string) (ServerSession, error) + GetServersByType func(Type string) []ServerSession + GetSettings func() conf.Config + NewProtocolMarshal func(data []byte) ProtocolMarshal + OnConfigurationLoaded func(func(app App)) error + OnDestroy func() error + OnInit func(settings conf.Config) error + OnModuleInited func(func(app App, module Module)) error + OnStartup func(func(app App)) error + Options func() Options + ProtocolMarshal func(Trace string, Result interface{}, Error string) (ProtocolMarshal, string) + Registry func() registry.Registry + RpcCall func(ctx context.Context, moduleType, _func string, param mqrpc.ParamOption, ...) (interface{}, string) + RpcInvoke func(module RPCModule, moduleType string, _func string, params ...interface{}) (interface{}, string) + RpcInvokeNR func(module RPCModule, moduleType string, _func string, params ...interface{}) error + Run func(mods ...Module) error + SetMapRoute func(fn func(app App, route string) string) error + SetProtocolMarshal func(...) error + Transport func() *nats.Conn + WorkDir func() string + type ClientRPCHandler func(app App, server registry.Node, rpcinfo rpcpb.RPCInfo, result interface{}, ...) + type JudgeGuest func(session gate.Session) bool + type Module interface + GetApp func() App + GetType func() string + OnAppConfigurationLoaded func(app App) + OnConfChanged func(settings *conf.ModuleSettings) + OnDestroy func() + OnInit func(app App, settings *conf.ModuleSettings) + Run func(closeSig chan bool) + Version func() string + type Option func(*Options) + func BILogDir(v string) Option + func Configure(v string) Option + func Debug(t bool) Option + func KillWaitTTL(t time.Duration) Option + func LogDir(v string) Option + func Nats(nc *nats.Conn) Option + func ProcessID(v string) Option + func RegisterInterval(t time.Duration) Option + func RegisterTTL(t time.Duration) Option + func Registry(r registry.Registry) Option + func Selector(r selector.Selector) Option + func SetClientRPChandler(t ClientRPCHandler) Option + func SetJudgeGuest(t JudgeGuest) Option + func SetServerRPCHandler(t ServerRPCHandler) Option + func Version(v string) Option + func WorkDir(v string) Option + type Options struct + BIDir string + ClientRPChandler ClientRPCHandler + ConfPath string + Debug bool + JudgeGuest JudgeGuest + KillWaitTTL time.Duration + LogDir string + Nats *nats.Conn + ProcessID string + RegisterInterval time.Duration + RegisterTTL time.Duration + Registry registry.Registry + Selector selector.Selector + ServerRPCHandler ServerRPCHandler + Version string + WorkDir string + type ProtocolMarshal interface + GetData func() []byte + type RPCModule interface + GetExecuting func() int64 + GetModuleSettings func() (settings *conf.ModuleSettings) + GetRouteServer func(filter string, opts ...selector.SelectOption) (ServerSession, error) + GetServerId func() string + GetStatistical func() (statistical string, err error) + RpcCall func(ctx context.Context, moduleType, _func string, param mqrpc.ParamOption, ...) (interface{}, string) + RpcInvoke func(moduleType string, _func string, params ...interface{}) (interface{}, string) + RpcInvokeArgs func(moduleType string, _func string, ArgsType []string, args [][]byte) (interface{}, string) + RpcInvokeNR func(moduleType string, _func string, params ...interface{}) error + RpcInvokeNRArgs func(moduleType string, _func string, ArgsType []string, args [][]byte) error + type RPCSerialize interface + Deserialize func(ptype string, b []byte) (param interface{}, err error) + GetTypes func() []string + Serialize func(param interface{}) (ptype string, p []byte, err error) + type ServerRPCHandler func(app App, module Module, callInfo mqrpc.CallInfo) + type ServerSession interface + Call func(ctx context.Context, _func string, params ...interface{}) (interface{}, string) + CallArgs func(ctx context.Context, _func string, ArgsType []string, args [][]byte) (interface{}, string) + CallNR func(_func string, params ...interface{}) (err error) + CallNRArgs func(_func string, ArgsType []string, args [][]byte) (err error) + GetApp func() App + GetId func() string + GetName func() string + GetNode func() *registry.Node + GetRpc func() mqrpc.RPCClient + SetNode func(node *registry.Node) (err error)