servers

package
v0.0.0-...-d26b62e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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 (s *UserServer) GetUserById(ctx context.Context, m *protos.GetUser) (*protos.User, error)

func (*UserServer) GetUserByUsername

func (s *UserServer) GetUserByUsername(ctx context.Context, m *protos.GetUser) (*protos.User, error)

func (*UserServer) GetUserStatus

UserStatusServer is a grpc server handler to get the status of a user (online, offline, ...)

func (*UserServer) RegisterGame

func (*UserServer) SaveUser

func (s *UserServer) SaveUser(ctx context.Context, m *protos.User) (*protos.User, error)

SaveUser saves a user to the database

func (*UserServer) UpdateUser

func (s *UserServer) UpdateUser(ctx context.Context, m *protos.User) (*protos.User, error)

Update user updates a user with the given id.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL