func GroupRemoveAll(ctx context.Context, groupName string) error {
	return groupServiceInstance.GroupRemoveAll(ctx, groupName)
}
GroupRemoveAll clears all UIDs
package pitaya
import (
	"context"
	"sync"
	"time"
	"github.com/topfreegames/pitaya/constants"
	"github.com/topfreegames/pitaya/groups"
	"github.com/topfreegames/pitaya/logger"
)
var (
	groupServiceInstance groups.GroupService
	groupsOnce           sync.Once  
)
func InitGroups(groupService groups.GroupService) {
	groupsOnce.Do(func() {
		groupServiceInstance = groupService
	})
}
func GroupCreate(ctx context.Context, groupName string) error {
	return groupServiceInstance.GroupCreate(ctx, groupName)
}
func GroupCreateWithTTL(ctx context.Context, groupName string, ttlTime time.Duration) error {
	return groupServiceInstance.GroupCreateWithTTL(ctx, groupName, ttlTime)
}
func GroupMembers(ctx context.Context, groupName string) ([]string, error) {
	return groupServiceInstance.GroupMembers(ctx, groupName)
}
func GroupBroadcast(ctx context.Context, frontendType, groupName, route string, v interface{}) error {
	logger.Log.Debugf("Type=Broadcast Route=%s, Data=%+v", route, v)
	members, err := GroupMembers(ctx, groupName)
	if err != nil {
		return err
	}
	return sendDataToMembers(members, frontendType, route, v)
}
func sendDataToMembers(uids []string, frontendType, route string, v interface{}) error {
	errUids, err := SendPushToUsers(route, v, uids, frontendType)
	if err != nil {
		logger.Log.Errorf("Group push message error, UID=%d, Error=%s", errUids, err.Error())
		return err
	}
	return nil
}
func GroupContainsMember(ctx context.Context, groupName, uid string) (bool, error) {
	if uid == "" {
		return false, constants.ErrEmptyUID
	}
	return groupServiceInstance.GroupContainsMember(ctx, groupName, uid)
}
func GroupAddMember(ctx context.Context, groupName, uid string) error {
	if uid == "" {
		return constants.ErrEmptyUID
	}
	logger.Log.Debugf("Add user to group %s, UID=%d", groupName, uid)
	return groupServiceInstance.GroupAddMember(ctx, groupName, uid)
}
func GroupRemoveMember(ctx context.Context, groupName, uid string) error {
	logger.Log.Debugf("Remove user from group %s, UID=%d", groupName, uid)
	return groupServiceInstance.GroupRemoveMember(ctx, groupName, uid)
}