-
Notifications
You must be signed in to change notification settings - Fork 173
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
feat(js-sdk): add Node.js SDK #262
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e53754e
feat(js-sdk): add Node.js SDK Client
fengmk2 b1ab5ec
feat(js-sdk): First impl for the State API
fengmk2 53862d5
feat(js-sdk): Impl Lock API
fengmk2 22dc76c
feat(js-sdk): Impl Sequencer API
fengmk2 f311045
add license headers
seeflood 869a829
feat(js-sdk): Impl Configuration API
fengmk2 5940b25
refactor(js-sdk): use Request args on SDK API
fengmk2 b14831b
Separate client and server
fengmk2 59a0dae
feat(js-sdk): Impl PubSub API
fengmk2 59ae031
Add license-checker script to Makefile
fengmk2 2b7b26a
feat(js-sdk): Impl File API
fengmk2 feb482f
feat(js-sdk): Impl Binding API
fengmk2 ef81bcf
test(js-sdk): skip unstable cases
fengmk2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ logs/ | |
/cover.out | ||
vendor/ | ||
demo/state/redis/client | ||
node_modules/ | ||
sdk/js-sdk/dist |
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,211 @@ | ||
{ | ||
"servers": [ | ||
{ | ||
"default_log_path": "stdout", | ||
"default_log_level": "DEBUG", | ||
"routers": [ | ||
{ | ||
"router_config_name": "http_router", | ||
"virtual_hosts": [ | ||
{ | ||
"name": "http_host", | ||
"domains": [ | ||
"*" | ||
], | ||
"routers": [ | ||
{ | ||
"match": { | ||
"headers": [ | ||
{ | ||
"name": "id", | ||
"value": "HelloService:1.0" | ||
} | ||
] | ||
}, | ||
"route": { | ||
"cluster_name": "http_server" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"router_config_name": "actuator_dont_need_router" | ||
} | ||
], | ||
"listeners": [ | ||
{ | ||
"name": "grpc", | ||
"address": "127.0.0.1:34904", | ||
"bind_port": true, | ||
"filter_chains": [ | ||
{ | ||
"filters": [ | ||
{ | ||
"type": "grpc", | ||
"config": { | ||
"server_name": "runtime", | ||
"grpc_config": { | ||
"rpcs": { | ||
"mosn": { | ||
"config": { | ||
"channel": [ | ||
{ | ||
"size": 16, | ||
"protocol": "http", | ||
"listener": "egress_runtime_http" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"hellos": { | ||
"helloworld": { | ||
"hello": "greeting" | ||
} | ||
}, | ||
"bindings": { | ||
"http": { | ||
"metadata": { | ||
"url": "https://registry.npmmirror.com/layotto/0.0.0" | ||
} | ||
} | ||
}, | ||
"config_stores": { | ||
"etcd": { | ||
"address": [ | ||
"127.0.0.1:2379" | ||
], | ||
"timeout": "10" | ||
} | ||
}, | ||
"state": { | ||
"redis": { | ||
"metadata": { | ||
"redisHost": "localhost:6380", | ||
"redisPassword": "" | ||
} | ||
} | ||
}, | ||
"sequencer": { | ||
"etcd": { | ||
"metadata": { | ||
"endpoints": "localhost:2379", | ||
"segmentCacheEnable": "false", | ||
"segmentStep": "1", | ||
"username": "", | ||
"password": "", | ||
"dialTimeout": "5" | ||
} | ||
}, | ||
"redis": { | ||
"metadata": { | ||
"redisHost": "127.0.0.1:6380", | ||
"redisPassword": "" | ||
} | ||
} | ||
}, | ||
"lock": { | ||
"etcd": { | ||
"metadata": { | ||
"endpoints": "localhost:2379", | ||
"username": "", | ||
"password": "", | ||
"keyPrefixPath": "/lock", | ||
"dialTimeout": "5" | ||
} | ||
}, | ||
"redis": { | ||
"metadata": { | ||
"redisHost": "localhost:6380", | ||
"redisPassword": "" | ||
} | ||
} | ||
}, | ||
"pub_subs": { | ||
"redis": { | ||
"metadata": { | ||
"redisHost": "localhost:6380", | ||
"redisPassword": "" | ||
} | ||
} | ||
}, | ||
"app": { | ||
"app_id": "app1", | ||
"grpc_callback_port": 9999 | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "actuator", | ||
"address": "127.0.0.1:34999", | ||
"bind_port": true, | ||
"filter_chains": [ | ||
{ | ||
"filters": [ | ||
{ | ||
"type": "proxy", | ||
"config": { | ||
"downstream_protocol": "Http1", | ||
"upstream_protocol": "Http1", | ||
"router_config_name": "actuator_dont_need_router" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"stream_filters": [ | ||
{ | ||
"type": "actuator_filter" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "egress_runtime_http", | ||
"type": "egress", | ||
"address": "0.0.0.0:12221", | ||
"bind_port": true, | ||
"network": "tcp", | ||
"filter_chains": [ | ||
{ | ||
"filters": [ | ||
{ | ||
"type": "proxy", | ||
"config": { | ||
"downstream_protocol": "Http1", | ||
"name": "proxy_config", | ||
"router_config_name": "http_router", | ||
"upstream_protocol": "Http1" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"cluster_manager": { | ||
"tls_context": {}, | ||
"clusters": [ | ||
{ | ||
"name": "http_server", | ||
"type": "SIMPLE", | ||
"lb_type": "LB_RANDOM", | ||
"hosts": [ | ||
{ | ||
"address": "127.0.0.1:8889", | ||
"hostname": "downstream_machine1", | ||
"weight": 1 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
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,59 @@ | ||
# | ||
# Copyright 2021 Layotto Authors | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
schedule: | ||
- cron: '0 2 * * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [14, 16] | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- name: Checkout Git Source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install Dependencies | ||
run: npm i -g npminstall && npminstall | ||
|
||
- name: Continuous Integration | ||
run: npm run ci | ||
|
||
- name: Code Coverage | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
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.
这里配置没有生效