Comments (4)
Also Time Threshold
currently converted as uint32, but it should be treated as time.Duration
.
Overall I like uint32
more, because it enforces you to think about rounding to seconds correctly, but for consistency it probably should be time.Duration
.
from go-pfcp.
Thanks, fixed in #123.
Overall I like uint32 more, because it enforces you to think about rounding to seconds correctly, but for consistency it probably should be time.Duration.
I understand it, and when passing values from a protocol to another this "friendliness" would bother as well. As you may already know, there is ie.New
function as a generic constructor for creating anything by hand, but this time I also exported these functions to make manual creation easier (and updated README). For value retrieval, I may add something to return "raw" type or may not - for now I don't think it's worth, but let me know your opinion if any.
// NewUint8ValIE creates a new IE with uint8 value.
func NewUint8IE(itype uint16, v uint8) *IE {
return newUint8ValIE(itype, v)
}
// NewUint16ValIE creates a new IE with uint16 value.
func NewUint16IE(itype uint16, v uint16) *IE {
return newUint16ValIE(itype, v)
}
// NewUint32ValIE creates a new IE with uint32 value.
func NewUint32IE(itype uint16, v uint32) *IE {
return newUint32ValIE(itype, v)
}
// NewUint64ValIE creates a new IE with uint64 value.
func NewUint64IE(itype uint16, v uint64) *IE {
return newUint64ValIE(itype, v)
}
// NewStringIE creates a new IE with string value.
func NewStringIE(itype uint16, v string) *IE {
return newStringIE(itype, v)
}
// NewFQDNIE creates a new IE with FQDN value.
func NewFQDNIE(itype uint16, v string) *IE {
return newFQDNIE(itype, v)
}
from go-pfcp.
Indeed it is good idea to expose some common methods like these, especially this could help with vendor ies
from go-pfcp.
Great, thanks for your feedback.
I haven't considered much about vendor-specific IEs so far, but now I'm wondering to add a value retrieving methods like ValueAsUint32()
for easier handling of vendor-specific IEs. I guess current users already have such functions on their own, but anyway.
from go-pfcp.
Related Issues (20)
- ADNP in PFDContents HOT 2
- [Question] About always calling ParseMultiIEs(i.Payload) in helper function HOT 4
- Create `XxxFields` struct for grouped IEs with many children
- Add `Value()` method on IE that returns the corresponding value of an IE HOT 2
- Add `AllIEs()` method on `Message` interface to retrieve all the IEs HOT 1
- `ParseSafe` isn't necessarily safe
- Avoiding slice out of bound error HOT 3
- Move usage description in README to godoc
- NewSMFSetID should be encoded as fqdn
- F-TEID unmarshalling and Enterprise IEs HOT 7
- Make golangci-lint happy HOT 1
- Some OctetString IEs should accept binary
- Follow changes in v17.0
- Network Instance IE encoding problem HOT 2
- User-id ie NAI flag problem HOT 2
- UserPlaneIPInformation Parsing ErrUnexpectedEOF
- Documentation of Header HOT 1
- Wrong method name in outer-header-removal
- Incorrect parameter name in NewRemoveFAR
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-pfcp.