Type fields in proto messages - #51
Closed
EP-u-NW wants to merge 3 commits into
Closed
Conversation
Contributor
Author
|
Moved to #54 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR discusses some changes about the proto definitions in SFSC.
Since all proposals target the proto files and therefor only internal behaviour, these changes should not affect end users.
Enforce strong type system:
Motivation behind this is, that in constrained static environments (like microcontrollers), it might be usefull to define compile time size limits on various proto fields. For example, all current SFSC implementations use 128 bit uuids as service, core and adapter ids. A constrained environment might limit all id fields to this size. In order to make that limiting consistent, a stronger typisation is usefull.
Stronger typsation also serves as additional documentation.
This PR proposes a
Id,MessageTypeandTopicproto message. Besides this new message types, the data field ofRegistryEntryis typed toSfscServiceDescriptor. Also theoneoffield ofCommandRequestandQueryReplygets typed, see below.Changes to
CommandRequestandQueryReply:The
oneof create_or_delete(andcreated_or_deleted_or_expired_or_futurerespectively) should be typed. To create a service, aSfscServiceDescriptoris necessary, to delete one, theserviceIdis sufficient.Also the fields of the
oneofare renamed, sincedeleteis a keyword in some languages (like C++).HeartbeatMessageThe id field is renamed (and typed) to adapter_id (to make it more obvious what kind of id this is).