-
Notifications
You must be signed in to change notification settings - Fork 167
V3 #11
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
Conversation
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
The Format interface has been renamed to DataType to resemble the RFC nomenclature. There's a slight change in the interface regarding the Format method and FormatId type, which are now Type and TypeID respectively. Test coverage is above 90% although some of the tests are very similar, since some types (e.g. DiameterIdentity, DiameterURI, etc) are inherited from base types like OctetString and Integer32. All comments and code conform 100% to golint.
There's a separate script to generate codes.go now. Not sure if this should be called automatically using Go generate for now, but it can in the future. The focus of this commit is to clean up the file and make it satisfy golint with no warnings - mostly about Id vs ID.
This is part of the rename of the "format" package to "datatype" and all sub-packages where it propagates.
Mostly comments and Id->ID
Currently 3 files are automatically generated from dictionaries that live in dict/testdata/*.xml: - commands.go: List of Diameter commands (CE, CC, etc) - avp/codes.go: List of AVP codes (OriginHost and so on) - dict/default.go: Default built-in dictionary parser There's no need to use Go generate for now, so once a dictionary is updated (although it shoudln't) or a new dictionary is added, we should run `sh autogen.sh` once. The generated code is gofmt'ed as expected. Since this commit, the default Parser will include both the Base dictionary (app=0) and the Credit Control dictionary (app=4).
Currently 3 files are automatically generated from dictionaries that live in dict/testdata/*.xml: - commands.go: List of Diameter commands (CE, CC, etc) - avp/codes.go: List of AVP codes (OriginHost and so on) - dict/default.go: Default built-in dictionary parser There's no need to use Go generate for now, so once a dictionary is updated (although it shoudln't) or a new dictionary is added, we should run `sh autogen.sh` once. The generated code is gofmt'ed as expected. Since this commit, the default Parser will include both the Base dictionary (app=0) and the Credit Control dictionary (app=4).
See this @dwilkie. |
👍 |
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 change has much better documentation and test coverage, adds support for a test server analogous to
net/http/httptest
, and has a few bug fixes (most notably in Float64 and Unsigned64).It fixes all warnings from
go vet
andgolint
, at the expense of being backwards incompatible. Constants likeSessionId
are nowSessionID
and so on. Also, theavp/format
package has been renamed todatatype
to reflect the RFC nomenclature.The default dictionary parser
dict.Default
has both the Base Protocol (app 0) and Credit Control (app 4) applications, and the standalone Credit Control is gone.