Documentation ¶
Index ¶
- type UserServer
- func (s *UserServer) GetUserById(ctx context.Context, m *protos.GetUser) (*protos.User, error)
- func (s *UserServer) GetUserByUsername(ctx context.Context, m *protos.GetUser) (*protos.User, error)
- func (s *UserServer) GetUserStatus(ctx context.Context, m *protos.UserStatusRequest) (*protos.UserStatusResponse, error)
- func (s *UserServer) RegisterGame(ctx context.Context, m *protos.RegisterGameRequest) (*protos.OnlineStatus, error)
- func (s *UserServer) SaveUser(ctx context.Context, m *protos.User) (*protos.User, error)
- func (s *UserServer) UpdateUser(ctx context.Context, m *protos.User) (*protos.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserServer ¶
type UserServer struct { protos.UnimplementedUserServiceServer // contains filtered or unexported fields }
UserServer is a grpc server handler to save, update or retrieve a user from the database
func NewUserServer ¶
func NewUserServer(logger *zap.SugaredLogger, database database.UserDB, statusDb database.OnlineStatusDB, metrics *metrics.User) *UserServer
NewUserServer create a new grpc user server
func (*UserServer) GetUserById ¶
func (*UserServer) GetUserByUsername ¶
func (*UserServer) GetUserStatus ¶
func (s *UserServer) GetUserStatus(ctx context.Context, m *protos.UserStatusRequest) (*protos.UserStatusResponse, error)
UserStatusServer is a grpc server handler to get the status of a user (online, offline, ...)
func (*UserServer) RegisterGame ¶
func (s *UserServer) RegisterGame(ctx context.Context, m *protos.RegisterGameRequest) (*protos.OnlineStatus, error)
func (*UserServer) UpdateUser ¶
Update user updates a user with the given id.
Click to show internal directories.
Click to hide internal directories.