You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: topic_service.go
    path of file: ./repos/nano/examples/cluster/master
    
    the code of the file until where you have to start completion: package master

import (
	"log"
	"strings"

	"github.com/lonng/nano/component"
	"github.com/lonng/nano/examples/cluster/protocol"
	"github.com/lonng/nano/session"
	"github.com/pingcap/errors"
)

type User struct {
	session  *session.Session
	nickname string
	gateId   int64
	masterId int64
	balance  int64
	message  int
}

type TopicService struct {
	component.Base
	nextUid int64
	users   ma
    
func (ts *TopicService) NewUser(s *session.Session, msg *protocol.NewUserRequest) error {
	ts.nextUid++
	uid := ts.nextUid
	if err := s.Bind(uid); err != nil {
		return errors.Trace(err)
	}

	var members []string
	for _, u := range ts.users {
		members = append(members, u.nickname)
	}
	err := s.Push("onMembers", &ExistsMembersResponse{Members: strings.Join(members, ",")})
	if err != nil {
		return errors.Trace(err)
	}

	user := &User{
		session:  s,
		nickname: msg.Nickname,
		gateId:   msg.GateUid,
		masterId: uid,
		balance:  1000,
	}
	ts.users[uid] = user

	chat := &protocol.JoinRoomRequest{
		Nickname:  msg.Nickname,
		GateUid:   msg.GateUid,
		MasterUid: uid,
	}
	return s.RPC("RoomService.JoinRoom", chat)
}