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.
Hello,
Nice implementation of OPC. However I quickly realised that I can't use it as is, since it is tailored quite specifically to one use case.
I wanted to write an OPC proxy, and that means I need raw access to the
Message
struct and so on. But as the current design is these are not exposed.I did some changes to the library that allows me to just use some parts, and implement the connection/listening and so exactly as I want to.
This is my first attempt at a Golang project so I can't say I'm an expert. I'm totally open to modifying this PR if you want that, since I'm aware these break backwards compatability.
Some notable changes:
Server
struct anyway. And this makes it possible to reuse in other code without being forced to useServer
.I made all fields in the
Message
struct exported. When I'm writing my proxy theDevice
concept does not really work, I just want to get the raw messages and send them on, and be able to check the channel and such for each message.Renamed constants and changed comments to follow the "go standard" better. Examples:
(Coming from C I kind of prefer your way as a matter of taste, but keeping to a language standard if there is such a clear one trumps that my personal taste any day).
Comments in Go should be of the form:
Rather than:
This is from
go vet
suggestions.Anyway, what I ended up using of this is the changes to the exposed fields in
Message
as well as makingReadOpc
a function that can be used standalone. So if you want me to modify the PR to only include those changes I can do that.