-
Notifications
You must be signed in to change notification settings - Fork 69
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
Expose the RemoteAddr via the Connection interface #57
Changes from 2 commits
5c43bf1
967d5df
dea2bd0
8fde9bb
49c6526
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,17 @@ package types | |
|
||
import ( | ||
"context" | ||
"net" | ||
|
||
"github.com/open-telemetry/opamp-go/protobufs" | ||
) | ||
|
||
// Connection represents one OpAMP WebSocket connections. | ||
// The implementation MUST be a comparable type so that it can be used as a map key. | ||
type Connection interface { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andykellr to support the use case that you have I think we also need to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andykellr this PR looks good to me now. I will merge as is and you can address this comment in a separate PR if you need the |
||
// RemoteAddr returns the remote network address of the connection. | ||
RemoteAddr() net.Addr | ||
|
||
// Send a message. Should not be called concurrently for the same Connection instance. | ||
// Blocks until the message is sent. | ||
// Should return as soon as possible if the ctx is cancelled. | ||
|
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.
Is this recursively calling itself or I am misreading the code?
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.
You didn't read that wrong. I put this PR together quickly to begin discussion and it was an oversight. It clearly needs a test case as well.