thin-edge / thin-edge.io

The open edge framework for lightweight IoT devices
https://thin-edge.io
Apache License 2.0
221 stars 54 forks source link

Group Cumulocity logic in a `c8y_api` crate #1405

Closed didier-wenzek closed 2 years ago

didier-wenzek commented 2 years ago

This refactoring task is part of https://github.com/thin-edge/thin-edge.io/issues/1401.

Motivation

The current code base contains 3 crates (c8y_api, c8y_smartrest and c8y_translator) containing Cumulocity related code, topic names, message payloads, translation functions ... The rationale for this structure is not clear. For instance, where is defined the Cumulocity Json format? Furthermore, many of these Cumulocity related entities are redefined by the mapper (under the tedge_mapper::c8y module) and the operation plugins (c8y_log_plugin and c8y_configuration_plugin). This makes the code difficult to maintain and things can only be worse over time without a share understanding of where to add and search Cumulocity related features.

Proposal

The proposal is to have a single crate, named c8y_api to gather all the definitions of Cumulocity specific entities.

rina23q commented 2 years ago

QA check passed, therefore close this issue.