Protobuf folder structure

Hey guys, I would like to suggest a organisation for future protobuf and gRPC definition.

Currently, we have a folder definition containing the definition of the Service and its data (and more will come like Execution), but also coreapi, serviceapi that each contains some gRPC services.

Then, I make some suggestion in Service compilation & deploy and Instance DB to create those new gRPC services in /protobuf/service/service.proto and /protobuf/instance/instance.proto but I’m actually not satisfied with this solution as there is only one file per folder and the name of the folder doesn’t say it only contains gRPC service.

My proposal is use the same logic as the folder definition (one folder containing one file per data) for all gRPC services. Create one folder protobuf/api containing one file per gRPC service.

The new file structure with the future execution, instance, service will look like:

- protobuf
  - acknowledgement // we don't touch this one
  - api
    - execution.proto
    - instance.proto
    - service.proto
  - definition
    - execution.proto
    - instance.proto
    - service.proto

As you see, we may end up with the same filenames in api and definition but I think it’s good for separation between data and gRPC services.

@core what do you think guys?

Agree, that’s what I already proposed for the Execution DB and API

1 Like

:+1:

but I don’t like the definition directory as it doesn’t give you info why it’s for. Definition of what? I don’t have better name but we need to figure it out.

Also, the question is what will be go package names?

I agree, definition doesn’t say it’s the data structure. What about models (like in MVC)?

the go package should be the same as the proto package, so api and definition. I think we can also remove the option go_package = "github.com/mesg-foundation/core/protobuf/service"; as it’s the same as the proto themselve!

models seems better, also i types might be good.