Documentation ¶
Index ¶
- Variables
- func AddNode(b host.IBuilder, registerFactory func() *NodeExOption)
- func InitOptions(opt *NodeBootOption)
- func NewService(name string) (int32, error)
- func StartService(saddr int32, arg interface{}) bool
- func StopService(saddr int32) bool
- type INodeAddr
- type IPromise
- type IProxy
- type IRpcContext
- type ITimer
- type Node
- type NodeAddr
- type NodeAddrUpdater
- type NodeBootOption
- type NodeConfigStruct
- type NodeExOption
- type Service
- func (ss *Service) After(delay time.Duration, f func()) ITimer
- func (ss *Service) Construct(logger *logging.Logger[Service])
- func (ss *Service) CreateProxy(name string) IProxy
- func (ss *Service) CreateProxyByNodeAddr(naddr INodeAddr, saddr int32) IProxy
- func (ss *Service) CreateProxyByNodeKind(naddr INodeAddr, name string) IProxy
- func (ss *Service) CreateProxyByUpdaterAddr(naddrUpdater *NodeAddrUpdater, saddr int32) IProxy
- func (ss *Service) CreateProxyByUpdaterKind(naddrUpdater *NodeAddrUpdater, name string) IProxy
- func (ss *Service) CreateProxyDefault() IProxy
- func (ss *Service) Debugf(format string, args ...any)
- func (ss *Service) EnableRPC()
- func (ss *Service) Entry(ctx IRpcContext, funcName string, ...) func()
- func (ss *Service) Errorf(format string, args ...any)
- func (ss *Service) Fatalf(format string, args ...any)
- func (ss *Service) Fork(tag string, f func())
- func (ss *Service) GetAddr() int32
- func (ss *Service) GetKind() int32
- func (ss *Service) GetLoad() float64
- func (ss *Service) GetMillisecond() int64
- func (ss *Service) GetName() string
- func (ss *Service) GetSecond() int64
- func (ss *Service) GetTime() time.Time
- func (ss *Service) Infof(format string, args ...any)
- func (ss *Service) NewService(name string) (int32, error)
- func (ss *Service) RpcReload(ctx IRpcContext)
- func (ss *Service) RpcStatus(ctx IRpcContext)
- func (ss *Service) SetAllowedRPC(names []string)
- func (ss *Service) Start(_ interface{})
- func (ss *Service) Stop(_ *sync.WaitGroup)
- func (ss *Service) Tick(interval, delay time.Duration, f func()) ITimer
- func (ss *Service) TickAfter(interval time.Duration, f func(func())) ITimer
- func (ss *Service) TickDelayRandom(interval time.Duration, f func()) ITimer
- func (ss *Service) Tracef(format string, args ...any)
- func (ss *Service) Warnf(format string, args ...any)
- type ServiceRegisterInfo
- type TagFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NodeAddrInvalid = NodeAddr(-1) NodeAddrLocal = NodeAddr(0) )
View Source
var ( ErrServiceNotExist = fmt.Errorf("service not exist") ErrNodeMessageChanFull = fmt.Errorf("note message chan full") ErrRequestTimeoutRemote = fmt.Errorf("session timeout from remote") ErrRequestTimeoutLocal = fmt.Errorf("session timeout from local") )
View Source
var EmptyContext = (IRpcContext)((*rpcContext)(nil))
View Source
var ErrRemoteDisconnected = fmt.Errorf("remote disconnected")
View Source
var NodeConfig = &NodeConfigStruct{ CurNodeMap: map[string]bool{}, }
Functions ¶
func AddNode ¶
func AddNode(b host.IBuilder, registerFactory func() *NodeExOption)
func InitOptions ¶
func InitOptions(opt *NodeBootOption)
func NewService ¶
func StartService ¶
func StopService ¶
Types ¶
type IRpcContext ¶
type NodeAddrUpdater ¶
type NodeAddrUpdater struct {
// contains filtered or unexported fields
}
func NewNodeAddrUpdater ¶
func NewNodeAddrUpdater(naddr NodeAddr, updateFunc func(chan<- *NodeAddr)) *NodeAddrUpdater
func (*NodeAddrUpdater) GetNodeAddr ¶
func (ss *NodeAddrUpdater) GetNodeAddr() NodeAddr
func (*NodeAddrUpdater) Start ¶
func (ss *NodeAddrUpdater) Start()
type NodeBootOption ¶
type NodeConfigStruct ¶
type NodeExOption ¶
type NodeExOption struct { ServiceRegisterInfos []*ServiceRegisterInfo ClientHandlePreprocessor net2.IPreprocessor ServerHandlePreprocessor net2.IPreprocessor }
type Service ¶
type Service struct { MethodMap map[string]reflect.Value // contains filtered or unexported fields }
func (*Service) CreateProxy ¶
func (*Service) CreateProxyByNodeAddr ¶
func (*Service) CreateProxyByNodeKind ¶
func (*Service) CreateProxyByUpdaterAddr ¶
func (ss *Service) CreateProxyByUpdaterAddr(naddrUpdater *NodeAddrUpdater, saddr int32) IProxy
func (*Service) CreateProxyByUpdaterKind ¶
func (ss *Service) CreateProxyByUpdaterKind(naddrUpdater *NodeAddrUpdater, name string) IProxy
func (*Service) CreateProxyDefault ¶
func (*Service) GetMillisecond ¶
func (*Service) RpcReload ¶
func (ss *Service) RpcReload(ctx IRpcContext)
func (*Service) RpcStatus ¶
func (ss *Service) RpcStatus(ctx IRpcContext)
func (*Service) SetAllowedRPC ¶
func (*Service) TickDelayRandom ¶
type ServiceRegisterInfo ¶
Click to show internal directories.
Click to hide internal directories.