friends/globals/get_user_data.go
Daniel López Guimaraes 2f80336681
Rename friends-secure to friends and remove Mongo
Replace MongoDB usage with GRPC calls to the account server. Also
include documentation on the README and a Makefile.
2023-08-13 01:05:08 +01:00

22 lines
516 B
Go

package globals
import (
"context"
pb "github.com/PretendoNetwork/grpc-go/account"
"github.com/PretendoNetwork/nex-protocols-go/globals"
"google.golang.org/grpc/metadata"
)
func GetUserData(pid uint32) (*pb.GetUserDataResponse, error) {
ctx := metadata.NewOutgoingContext(context.Background(), GRPCAccountCommonMetadata)
response, err := GRPCAccountClient.GetUserData(ctx, &pb.GetUserDataRequest{Pid: pid})
if err != nil {
globals.Logger.Error(err.Error())
return nil, err
}
return response, nil
}