-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add 'noop' transport #145
Add 'noop' transport #145
Conversation
What is purpose of such functionality? It seems that I can call
|
Yes, it does convert |
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 few comments and suggestions.
cmd/yggd/main.go
Outdated
@@ -140,6 +140,12 @@ func setupClient( | |||
if err != nil { | |||
return nil, nil, cli.Exit(fmt.Errorf("cannot create HTTP transport: %w", err), 1) | |||
} | |||
case "", "noop": |
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 would use only "noop". I would not use "" as another option for this "protocol". I will explain why.
Common practice is following. When "" is used for value of some option, then default option is used (default protocol is "mqtt"). Thus suggested behavior would be confusing. The "noop"
could be used in /etc/yggdrasil/config.toml
for option protocol
, right?
BTW: Is the "noop" the best keyword? I think that it is not so well known word. I tried to find it in some dictionaries and most dictionaries does not contain this word. What about "none" keyword for this purpose? If the "noop" was used, then I would add some description to man page. The problem is that we generate man page. Adding additional information to man page would probably require adding custom function for generating man page.
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.
Hm. Yes. I thought about whether I should include "" or not. You make a good point. I'll drop it from the case condition. I went around and around on a name, including LoopTransport
, NullTransport
and a few others. Neither name really fit the functionality of the transport until I settled on the term "no-op". It's an abbreviation for "no operation". I felt this name fit the functionality of the transport quite well, as it doesn't loop anything back; it just takes no operation on the data. I like the term "none" to describe the protocol. Any objections against?
case "", "noop": | |
case "none", "noop": |
OK. It makes sense. |
10b65ee
to
8aaa72b
Compare
527518c
to
235153b
Compare
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 would use "none" or "noop". Not both. It could be confusing to see "noop" and "none" for the same thing.
235153b
to
ae7be8a
Compare
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 promise that have final request/comment. :-)
ae7be8a
to
90d3541
Compare
Add a noop transport option. Setting the config flag 'protocol' to "none" or "" will configure yggd with a no-op transport. All the rest of the dispatch and routing flows are unaffected, but no data is transported to or from the client. Signed-off-by: Link Dupont <link@sub-pop.net>
90d3541
to
bd0b192
Compare
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.
LGTM. 👍 Thanks for updates.
Add a noop transport option. Setting the config flag 'protocol' to
"noop" or "" will configure yggd with a no-op transport. All the rest of
the dispatch and routing flows are unaffected, but no data is
transported to or from the client.