Versions in this module Expand all Collapse all v0 v0.0.5 Jan 19, 2023 Changes in this version + var ErrInvalidArgument = link.ErrInvalidArgument + var ErrInvalidGID = link.ErrInvalidGID + var ErrInvalidMessage = link.ErrInvalidMessage + var ErrInvalidNID = link.ErrInvalidNID + var ErrInvalidSessionKind = link.ErrInvalidSessionKind + var ErrNotFoundUserSource = link.ErrNotFoundUserSource + var ErrReceiveTargetEmpty = link.ErrReceiveTargetEmpty + type BroadcastArgs = link.BroadcastArgs + type DeliverArgs struct + Message *Message + NID string + UID int64 + type DisconnectArgs = link.DisconnectArgs + type EventHandler func(gid string, uid int64) + type GetIPArgs = link.GetIPArgs + type Message = link.Message + type MulticastArgs = link.MulticastArgs + type Node struct + func NewNode(opts ...Option) *Node + 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 WithCodec(codec encoding.Codec) Option + func WithContext(ctx context.Context) Option + func WithDecryptor(decryptor crypto.Decryptor) 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 + type Proxy interface + AddEventListener func(event cluster.Event, handler EventHandler) + AddRouteHandler func(route int32, stateful bool, handler RouteHandler) + BindGate func(ctx context.Context, gid string, cid, uid int64) error + BindNode func(ctx context.Context, uid int64, nid ...string) error + Broadcast func(ctx context.Context, args *BroadcastArgs) (int64, error) + Deliver func(ctx context.Context, args *DeliverArgs) error + Disconnect func(ctx context.Context, args *DisconnectArgs) error + FetchGateList func(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error) + FetchNodeList func(ctx context.Context, states ...cluster.State) ([]*registry.ServiceInstance, error) + GetID func() string + GetIP func(ctx context.Context, args *GetIPArgs) (string, error) + GetName func() string + LocateGate func(ctx context.Context, uid int64) (string, error) + LocateNode func(ctx context.Context, uid int64) (string, error) + Multicast func(ctx context.Context, args *MulticastArgs) (int64, error) + Push func(ctx context.Context, args *PushArgs) error + Response func(ctx context.Context, req Request, message interface{}) error + SetDefaultRouteHandler func(handler RouteHandler) + UnbindGate func(ctx context.Context, uid int64) error + UnbindNode func(ctx context.Context, uid int64, nid ...string) error + type PushArgs = link.PushArgs + type Request interface + BindGate func(uid int64) error + BindNode func() error + CID func() int64 + Context func() context.Context + Data func() interface{} + Disconnect func(isForce ...bool) error + GID func() string + GetIP func() (string, error) + NID func() string + Parse func(v interface{}) error + Response func(message interface{}) error + Route func() int32 + Seq func() int32 + UID func() int64 + UnbindGate func() error + UnbindNode func() error + type RouteHandler func(req Request)