slaventius 2 years ago
parent b37723b219
commit f256615246
  1. 6
      internal/transport/grpc/grpc.go

@ -21,7 +21,7 @@ type user struct {
type authDBServer struct { type authDBServer struct {
mu sync.Mutex mu sync.Mutex
users map[string]*user users map[string]user
api.UnimplementedAuthDBServer api.UnimplementedAuthDBServer
id int32 id int32
} }
@ -29,7 +29,7 @@ type authDBServer struct {
func NewServer() *authDBServer { func NewServer() *authDBServer {
return &authDBServer{ return &authDBServer{
mu: sync.Mutex{}, mu: sync.Mutex{},
users: make(map[string]*user), users: make(map[string]user),
id: 0, id: 0,
} }
} }
@ -83,7 +83,7 @@ func (s *authDBServer) Registration(ctx context.Context, req *api.RegistrationRe
code := strconv.Itoa(unique / 2) code := strconv.Itoa(unique / 2)
// //
s.users[req.Login] = &user{ s.users[req.Login] = user{
ID: s.id, ID: s.id,
Code: code, Code: code,
Login: req.Login, Login: req.Login,

Loading…
Cancel
Save