mirror of
https://github.com/PretendoNetwork/friends.git
synced 2024-06-01 11:37:53 -04:00
2f80336681
Replace MongoDB usage with GRPC calls to the account server. Also include documentation on the README and a Makefile.
22 lines
516 B
Go
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
|
|
}
|