Skip to content

Show new code layout #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Show new code layout #243

wants to merge 1 commit into from

Conversation

masci
Copy link
Contributor

@masci masci commented Jun 10, 2019

As discussed internally, this PR has the sole purpose of showing one of the options being considered to refactor the code in order to ease maintenance and readability.

The general philosophy is to consider commands a service provider to be used by the CLI and possibly by other consumers. The commands public API is mapped with Protocol buffers so that can be consumed through a gRPC client as well. These would be the macro components of the codebase after this refactoring:

  • package cli: implements the CLI
  • package commands: implements high-level functions used by the CLI and exported through rpc
  • package arduino: implements low-level functions, used by commands and go-importable in other projects (provided one knows what they're doing)

proto-gen folders contains the (versioned) generated code of the components we export through rpc (for now, only commands).

Implementation-wise, this is the less invasive option, mainly focues on a few things:

  • use Task to orchestrate protoc
  • move proto definitions close to the models they represent (under commands) so we don't need the root package rpc anymore
  • make the use of generated code explicit and versioned (see rpc_v1)
  • reduce the number of packages at the root, moving daemon within commands

@masci masci closed this Jun 13, 2019
per1234 added a commit that referenced this pull request Aug 9, 2021
@per1234 per1234 deleted the massi/rpc branch May 4, 2022 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant