Let’s say we have a struct on go that looks like this
type PlayerData struct {
Amount int `json:"amount"`
Count uint `json:"count"`
Id string `json:"id"`
}
and also a c# counterpart for unity client
[Serializable]
class PlayerData
{
public int amount;
public int count;
public string id;
}
Above are a simplified example, but in reality there are a couple of “messages” that needs to be coded on the go module in order to reflect the message that could be received client side, some enums that needs to be coded both on client and server side.
Imagine a send reward system from nakama console that could be send via notification, it can be set for a particular user, change the amount of the reward, set the reward types, and then finally sent to the player.
In order to prevent error and reduce bugs, what is the preferred / the usual way to make a struct defines that could be compiled / transcribed into go and c# code? similar to what protoc compiler did to .proto files, but leaner as in only generate the required struct/classes?