-
Notifications
You must be signed in to change notification settings - Fork 154
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
Use pointers for optional datatypes. Use arrays for fixed size sets #204
Conversation
Split from #151 |
Pull Request Test Coverage Report for Build 1090436413
💛 - Coveralls |
How come a pointer to an atomic type and not the atomic type itself? That enforces "strange looking code" on the client, such as:
I would just like to understand why that should be the case here. |
@alexanderConstantinescu because the field needs to be nillable as its optional. Otherwise we end up with serialisation problems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not spotted anything weird code wise, just formatting nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For users not using modelgen I think we should add a brief comment on some of the documentation (maybe api/doc.go or main Readme.md)
Sets with min 1 and max 1 are a type Sets with min 0 and max 1 are a pointer to a type Sets with a max > 1 (non-default) are an array Otherwise a set is represented by a slice Signed-off-by: Dave Tucker <[email protected]>
This handles mapping from OvsToNative - min 0, max > 1 && !unlimted to an array - min 0, max 1 to a pointer - min 0, max unlimited to a slice And in NativeToOvs, we convert all cases back in to an OvsSet Signed-off-by: Dave Tucker <[email protected]>
This PR changes:
Fixes: #191