-
Notifications
You must be signed in to change notification settings - Fork 80
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
Function-based discovery API alternative #864
Closed
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
b8e5d92
chore!: bump tsc target to es2018
JKRhb 1030684
feat!: add proposal for new discovery API
JKRhb 96be7f4
fixup! feat!: add proposal for new discovery API
JKRhb 7f40323
fixup! feat!: add proposal for new discovery API
JKRhb d68f9df
fixup! feat!: add proposal for new discovery API
JKRhb 880558e
fixup! feat!: add proposal for new discovery API
JKRhb d1ec05f
fixup! feat!: add proposal for new discovery API
JKRhb 37a1620
fixup! feat!: add proposal for new discovery API
JKRhb 6ee7d4b
fixup! feat!: add proposal for new discovery API
JKRhb cf5a391
fixup! feat!: add proposal for new discovery API
JKRhb 734f86b
fixup! feat!: add proposal for new discovery API
JKRhb 04b7b2f
fixup! feat!: add proposal for new discovery API
JKRhb 5440bea
fixup! feat!: add proposal for new discovery API
JKRhb db320c1
fixup! feat!: add proposal for new discovery API
JKRhb 74b0e37
fixup! feat!: add proposal for new discovery API
JKRhb 2207a91
fixup! feat!: add proposal for new discovery API
JKRhb ad43508
fixup! feat!: add proposal for new discovery API
JKRhb b869b5c
fixup! feat!: add proposal for new discovery API
JKRhb 961606e
fixup! feat!: add proposal for new discovery API
JKRhb 950faa3
fixup! feat!: add proposal for new discovery API
JKRhb 5636983
fixup! feat!: add proposal for new discovery API
JKRhb 88252f0
fixup! feat!: add proposal for new discovery API
JKRhb 44af619
fixup! feat!: add proposal for new discovery API
JKRhb 495b857
fixup! feat!: add proposal for new discovery API
JKRhb ccd7751
fixup! feat!: add proposal for new discovery API
JKRhb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { Servient } = require("@node-wot/core"); | ||
const { HttpClientFactory } = require("@node-wot/binding-http"); | ||
const { CoapClientFactory } = require("@node-wot/binding-coap"); | ||
|
||
// Note: This example is just for testing/demonstration purposes and | ||
// will eventually be removed/moved to the examples package. | ||
async function discover() { | ||
const servient = new Servient(); | ||
servient.addClientFactory(new HttpClientFactory()); | ||
servient.addClientFactory(new CoapClientFactory()); | ||
const wot = await servient.start(); | ||
|
||
const httpUrl = "http://plugfest.thingweb.io:8083/smart-coffee-machine"; | ||
const coapUrl = "coap://plugfest.thingweb.io:5683/smart-coffee-machine"; | ||
|
||
for (const url of [httpUrl, coapUrl]) { | ||
console.log(await wot.discovery.direct(url)); | ||
} | ||
|
||
// Alternative approach | ||
for (const url of [httpUrl, coapUrl]) { | ||
for await (const result of wot.discovery.directIterator(url)) { | ||
console.log(result); | ||
} | ||
} | ||
} | ||
|
||
discover(); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
No real review yet.. just since I stumbled over this change
I am not sure but I think we used to have issues with the browser-bundle when increasing the target version.. I might be wrong though...