Versions in this module Expand all Collapse all v2 v2.2.7 Jul 12, 2025 Changes in this version + type Actor struct + func (a *Actor) AddEventHandler(event cluster.Event, handler EventHandler) + func (a *Actor) AddRouteHandler(route int32, handler RouteHandler) + func (a *Actor) AfterFunc(d time.Duration, f func()) *Timer + func (a *Actor) AfterInvoke(d time.Duration, f func()) *Timer + func (a *Actor) Deliver(uid int64, message *cluster.Message) error + func (a *Actor) Destroy() (ok bool) + func (a *Actor) ID() string + func (a *Actor) Invoke(fn func()) + func (a *Actor) Kind() string + func (a *Actor) Next(ctx Context) + func (a *Actor) PID() string + func (a *Actor) Proxy() *Proxy + func (a *Actor) Push(uid int64, message *cluster.Message) error + func (a *Actor) Spawn(creator Creator, opts ...ActorOption) (*Actor, error) + type ActorOption func(o *actorOptions) + func WithActorArgs(args ...any) ActorOption + func WithActorID(id string) ActorOption + func WithActorKind(kind string) ActorOption + func WithActorNonDispatch() ActorOption + func WithActorNonWait() ActorOption + type BaseProcessor struct + func (b *BaseProcessor) Destroy() + func (b *BaseProcessor) Init() + func (b *BaseProcessor) Start() + type Context interface + Actor func(kind, id string) (*Actor, bool) + AfterFunc func(d time.Duration, f func()) *Timer + AfterInvoke func(d time.Duration, f func()) *Timer + BindActor func(kind, id string) error + BindGate func(uid ...int64) error + BindNode func(uid ...int64) error + CID func() int64 + Cancel func() + Clone func() Context + Context func() context.Context + Defer func(fn func(), bottom ...bool) + Deliver func(args *cluster.DeliverArgs) error + Disconnect func(force ...bool) error + Event func() cluster.Event + GID func() string + GetIP func() (string, error) + GetValue func(key any) any + Invoke func(fn func()) + Kill func(kind, id string) bool + Kind func() Kind + NID func() string + NewMeshClient func(target string) (transport.Client, error) + Next func() error + Parse func(v interface{}) error + Proxy func() *Proxy + Reply func(message *cluster.Message) error + Response func(message interface{}) error + Route func() int32 + Seq func() int32 + SetValue func(key, val any) + Spawn func(creator Creator, opts ...ActorOption) (*Actor, error) + Task func(fn func(ctx Context)) + UID func() int64 + UnbindActor func(kind string) + UnbindGate func(uid ...int64) error + UnbindNode func(uid ...int64) error + type Creator func(actor *Actor, args ...any) Processor + type EventHandler func(ctx Context) + type HookHandler func(proxy *Proxy) + type Kind int + const Event + const Request + type Middleware struct + func (m *Middleware) Next(ctx Context) + func (m *Middleware) Skip(ctx Context, skip int) + type MiddlewareHandler func(middleware *Middleware, ctx Context) + type Node struct + func NewNode(opts ...Option) *Node + func (n *Node) Close() + func (n *Node) Destroy() + func (n *Node) Init() + func (n *Node) Name() string + func (n *Node) Proxy() *Proxy + func (n *Node) Start() + type Option func(o *options) + func WithAddr(addr string) Option + func WithCodec(codec encoding.Codec) Option + func WithContext(ctx context.Context) Option + func WithEncryptor(encryptor crypto.Encryptor) Option + func WithID(id string) Option + func WithLocator(locator locate.Locator) Option + func WithName(name string) Option + func WithRegistry(r registry.Registry) Option + func WithTimeout(timeout time.Duration) Option + func WithTransporter(transporter transport.Transporter) Option + func WithWeight(weight int) Option + type Processor interface + Destroy func() + Init func() + Start func() + type Proxy struct + func (p *Proxy) Actor(kind, id string) (*Actor, bool) + func (p *Proxy) AddEventHandler(event cluster.Event, handler EventHandler) + func (p *Proxy) AddHookListener(hook cluster.Hook, handler HookHandler) + func (p *Proxy) AddInternalRouteHandler(route int32, stateful bool, handler RouteHandler, ...) + func (p *Proxy) AddRouteHandler(route int32, stateful bool, handler RouteHandler, ...) + func (p *Proxy) AddServiceProvider(name string, desc, provider interface{}) + func (p *Proxy) AfterFunc(d time.Duration, f func()) *Timer + func (p *Proxy) AfterInvoke(d time.Duration, f func()) *Timer + func (p *Proxy) AskGate(ctx context.Context, gid string, uid int64) (string, bool, error) + func (p *Proxy) AskNode(ctx context.Context, uid int64, name, nid string) (string, bool, error) + func (p *Proxy) BindActor(uid int64, kind, id string) error + func (p *Proxy) BindGate(ctx context.Context, gid string, cid, uid int64) error + func (p *Proxy) BindNode(ctx context.Context, uid int64, nameAndNID ...string) error + func (p *Proxy) Broadcast(ctx context.Context, args *cluster.BroadcastArgs) error + func (p *Proxy) Deliver(ctx context.Context, args *cluster.DeliverArgs) error + func (p *Proxy) Disconnect(ctx context.Context, args *cluster.DisconnectArgs) error + func (p *Proxy) FetchGateList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error) + func (p *Proxy) FetchNodeList(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error) + func (p *Proxy) GetID() string + func (p *Proxy) GetIP(ctx context.Context, args *cluster.GetIPArgs) (string, error) + func (p *Proxy) GetName() string + func (p *Proxy) GetState() cluster.State + func (p *Proxy) HasGate(gid string) bool + func (p *Proxy) HasNode(nid string) bool + func (p *Proxy) Invoke(fn func()) + func (p *Proxy) IsOnline(ctx context.Context, args *cluster.IsOnlineArgs) (bool, error) + func (p *Proxy) Kill(kind, id string) bool + func (p *Proxy) LocateGate(ctx context.Context, uid int64) (string, error) + func (p *Proxy) LocateNode(ctx context.Context, uid int64, name string) (string, error) + func (p *Proxy) Multicast(ctx context.Context, args *cluster.MulticastArgs) error + func (p *Proxy) NewMeshClient(target string) (transport.Client, error) + func (p *Proxy) PackBuffer(message any) ([]byte, error) + func (p *Proxy) PackMessage(message *cluster.Message) ([]byte, error) + func (p *Proxy) Push(ctx context.Context, args *cluster.PushArgs) error + func (p *Proxy) RouteGroup(groups ...func(group *RouterGroup)) *RouterGroup + func (p *Proxy) Router() *Router + func (p *Proxy) SetDefaultRouteHandler(handler RouteHandler) + func (p *Proxy) SetState(state cluster.State) error + func (p *Proxy) Spawn(creator Creator, opts ...ActorOption) (*Actor, error) + func (p *Proxy) Stat(ctx context.Context, kind session.Kind) (int64, error) + func (p *Proxy) Trigger() *Trigger + func (p *Proxy) UnbindActor(uid int64, kind string) + func (p *Proxy) UnbindGate(ctx context.Context, uid int64) error + func (p *Proxy) UnbindNode(ctx context.Context, uid int64, nameAndNID ...string) error + type RouteHandler func(ctx Context) + type RouteOptions struct + Internal bool + Middlewares []MiddlewareHandler + Restricted bool + Stateful bool + type Router struct + func (r *Router) AddInternalRouteHandler(route int32, stateful bool, handler RouteHandler, ...) + func (r *Router) AddRouteHandler(route int32, stateful bool, handler RouteHandler, ...) + func (r *Router) CheckRouteStateful(route int32) (stateful bool, exist bool) + func (r *Router) Group(groups ...func(group *RouterGroup)) *RouterGroup + func (r *Router) HasDefaultRouteHandler() bool + func (r *Router) SetDefaultRouteHandler(handler RouteHandler) + func (r *Router) SetPostRouteHandler(handler RouteHandler) + func (r *Router) SetPreRouteHandler(handler RouteHandler) + type RouterGroup struct + func (g *RouterGroup) AddInternalRouteHandler(route int32, stateful bool, handler RouteHandler, ...) *RouterGroup + func (g *RouterGroup) AddRouteHandler(route int32, stateful bool, handler RouteHandler, ...) *RouterGroup + func (g *RouterGroup) Middleware(middlewares ...MiddlewareHandler) *RouterGroup + type Scheduler struct + type SchedulingModel string + type Timer struct + func (t *Timer) Stop() (ok bool) + type Trigger struct + func (e *Trigger) AddEventHandler(event cluster.Event, handler EventHandler)