Versions in this module Expand all Collapse all v0 v0.5.0 Apr 6, 2023 Changes in this version + var ErrCloseClosedGroup = errors.New("close closed group") + var ErrClosedGroup = errors.New("group closed") + var ErrMemberNotFound = errors.New("member not found in the group") + var ErrSessionDuplication = errors.New("session has existed in the current group") + var VERSION = "0.5.0" + func Listen(addr string, opts ...Option) + func Shutdown() + type Group struct + func NewGroup(n string) *Group + func (c *Group) Add(session *session.Session) error + func (c *Group) Broadcast(route string, v interface{}) error + func (c *Group) Close() error + func (c *Group) Contains(uid int64) bool + func (c *Group) Count() int + func (c *Group) Leave(s *session.Session) error + func (c *Group) LeaveAll() error + func (c *Group) Member(uid int64) (*session.Session, error) + func (c *Group) Members() []int64 + func (c *Group) Multicast(route string, v interface{}, filter SessionFilter) error + type Option func(*cluster.Options) + func WithAdvertiseAddr(addr string, retryInterval ...time.Duration) Option + func WithCheckOriginFunc(fn func(*http.Request) bool) Option + func WithClientAddr(addr string) Option + func WithComponents(components *component.Components) Option + func WithCustomerRemoteServiceRoute(route cluster.CustomerRemoteServiceRoute) Option + func WithDebugMode() Option + func WithDictionary(dict map[string]uint16) Option + func WithGrpcOptions(opts ...grpc.DialOption) Option + func WithHandshakeValidator(fn func([]byte) error) Option + func WithHeartbeatInterval(d time.Duration) Option + func WithIsWebsocket(enableWs bool) Option + func WithLabel(label string) Option + func WithLogger(l log.Logger) Option + func WithMaster() Option + func WithNodeId(nodeId uint64) Option + func WithPipeline(pipeline pipeline.Pipeline) Option + func WithSerializer(serializer serialize.Serializer) Option + func WithTSLConfig(certificate, key string) Option + func WithTimerPrecision(precision time.Duration) Option + func WithUnregisterCallback(fn func(member cluster.Member)) Option + func WithWSPath(path string) Option + type SessionFilter func(*session.Session) bool