-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add darabonba sdk & demo & sdk docs;
support java, go, php, py3, ts, csharp
- Loading branch information
Showing
590 changed files
with
87,388 additions
and
0 deletions.
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 |
---|---|---|
|
@@ -22,3 +22,7 @@ domain/target/ | |
start/target/ | ||
common/target/ | ||
supports/*/target/ | ||
*libraries* | ||
.vscode/ | ||
node_modules/ | ||
*.sln |
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,87 @@ | ||
{ | ||
"scope": "SDKClient", | ||
"name": "sdk-client", | ||
"version": "1.0.0", | ||
"main": "./main.dara", | ||
"libraries": { | ||
"Util": "darabonba:Util:*", | ||
"OpenApi": "alibabacloud:OpenApi:*" | ||
}, | ||
"releases": { | ||
"java": "org.apache.rocketmq.eventbridge:sdk:0.0.0", | ||
"go": "github.com/org-apache-rocketmq/eventbridge-sdk/client:v0.0.0", | ||
"csharp": "RocketMQ.Eventbridge.SDK:1.0.0", | ||
"ts": "@org.apache.rocketmq/eventbridge-sdk:0.0.0", | ||
"php": "rocketmq/eventbridge-sdk:0.0.0", | ||
"python": "rocketmq_eventbridge20240701:0.0.0" | ||
}, | ||
"java": { | ||
"className": "Client", | ||
"package": "org.apache.rocketmq.eventbridge.sdk", | ||
"enableMinimizeModelName": false, | ||
"packageInfo": { | ||
"groupId": "org.apache.rocketmq.eventbridge", | ||
"artifactId": "sdk", | ||
"version": "0.0.0", | ||
"description": "Eventbridge (20240701) SDK for Java", | ||
"url": "", | ||
"licenseName": "The Apache License, Version 2.0", | ||
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt", | ||
"developerId": "rocketmq", | ||
"developerName": "rocketmq", | ||
"developerEmail": "[email protected]" | ||
} | ||
}, | ||
"ts":{ | ||
"packageName": "SDKClient" | ||
}, | ||
"csharp": { | ||
"className": "SDKClient", | ||
"namespace": "RocketMQ.Eventbridge.SDK", | ||
"packageInfo": { | ||
"name": "sdk", | ||
"version": "0.0.0", | ||
"title": "eventbridge-sdk", | ||
"description": "open source eventbridge (20240701) SDK Library for .NET" | ||
} | ||
}, | ||
"php": { | ||
"package": "RocketMQ.Eventbridge.SDK", | ||
"clientName": "SDKClient", | ||
"packageInfo": { | ||
"name": "rocketmq/eventbridge-sdk", | ||
"desc": "RocketMQ eventbridge (20240701) SDK Library for PHP", | ||
"github": "unavailable", | ||
"files": { | ||
"LICENSE": "../LICENSE" | ||
} | ||
} | ||
}, | ||
"python": { | ||
"package": "rocketmq_eventbridge", | ||
"clientName": "client", | ||
"packageInfo": { | ||
"name": "rocketmq_eventbridge", | ||
"desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Python", | ||
"github": "https://github.com/aliyun/alibabacloud-python-sdk", | ||
"author": "Alibaba Cloud SDK", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"swift": { | ||
"clientName": "Client", | ||
"packageInfo": { | ||
"name": "AlibabacloudEventbridge20240701", | ||
"desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Swift", | ||
"github": "https://github.com/alibabacloud-sdk-swift/eventbridge-20240701", | ||
"author": "Alibaba Cloud SDK", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"go": { | ||
"interface": true, | ||
"clientName": "Client" | ||
}, | ||
"productId": "eventbridge", | ||
"apiVersions": "2024-07-01" | ||
} |
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,37 @@ | ||
# Daranbonba | ||
|
||
通过 darabonba 生成的多语言 SDK 实现对 eventBridge 进行 RPC 管控 | ||
|
||
# 多语言 SDK 生成 | ||
|
||
## dara 安装 | ||
|
||
``` | ||
npm install @darabonba/cli -g | ||
``` | ||
|
||
# 目录结构 | ||
|
||
- demo | ||
- 包含了 sdk demo 的源码和生成样例,按 controller 分类 | ||
- doc | ||
- 各语言的 sdk 生成使用文档 | ||
- generated | ||
- 包含了 sdk client 的各语言生成样例 | ||
- Darafile | ||
- dara 配置文件 | ||
- main.dara | ||
- dara 源码 | ||
|
||
# 支持语言 | ||
|
||
- Java | ||
- golang | ||
- csharp | ||
- php | ||
- python | ||
- ts | ||
|
||
# 使用 | ||
各语言 sdk 使用方法请参考 doc 中的文档 | ||
|
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,66 @@ | ||
{ | ||
"scope": "Demo", | ||
"name": "demo", | ||
"version": "0.0.0", | ||
"main": "./demo.dara", | ||
"libraries": { | ||
"SDKClient" : "../../", | ||
"Util": "darabonba:Util:*", | ||
"OpenApi": "alibabacloud:OpenApi:*", | ||
"OpenApiUtil": "alibabacloud:OpenApiUtil:*", | ||
"Console": "darabonba:Console:*" | ||
}, | ||
"java": { | ||
"package": "org.apache.rocketmq.eventbridge.demo", | ||
"className": "Demo", | ||
"packageInfo": { | ||
"groupId": "org.apache.rocketmq.eventbridge", | ||
"artifactId": "demo", | ||
"version": "0.0.0", | ||
"description": "EventBridge SDK demo for Java", | ||
"url": "", | ||
"licenseName": "The Apache License, Version 2.0", | ||
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt", | ||
"developerId": "ludi", | ||
"developerName": "EventBridge SDK", | ||
"developerEmail": "[email protected]", | ||
"scmConnection": "", | ||
"scmDeveloperConnection": "", | ||
"scmUrl": "" | ||
} | ||
}, | ||
"go": { | ||
"clientName": "DemoClient" | ||
}, | ||
"csharp": { | ||
"className": "Demo", | ||
"namespace": "RocketMQ.Eventbridge.Demo", | ||
"packageInfo": { | ||
"name": "sdkDemo", | ||
"version": "0.0.0", | ||
"title": "eventbridge-sdk-demo", | ||
"description": "open source eventbridge (20240701) SDK Demo Library for .NET" | ||
} | ||
}, | ||
"php": { | ||
"package": "RocketMQ.Eventbridge.SDK.Demo", | ||
"clientName": "Demo", | ||
"packageInfo": { | ||
"name": "rocketmq/eventbridge-sdk-demo", | ||
"desc": "RocketMQ eventbridge (20240701) SDK Demo for PHP", | ||
"github": "unavailable", | ||
"files": { | ||
"LICENSE": "../LICENSE" | ||
} | ||
} | ||
}, | ||
"python": { | ||
"package": "rocketmq_eventbridge_demo", | ||
"clientName": "demo", | ||
"packageInfo": { | ||
"name": "rocketmq_eventbridge_demo", | ||
"desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Python", | ||
"github": "unavailable" | ||
} | ||
} | ||
} |
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,117 @@ | ||
import Util; | ||
import OpenApi; | ||
import SDKClient; | ||
import Console; | ||
|
||
type @sdkClient = SDKClient; | ||
type @endpoint = string; | ||
|
||
init(){ | ||
@endpoint = '127.0.0.1:7001'; | ||
var config = new OpenApi.Config{ | ||
endpoint = @endpoint | ||
}; | ||
@sdkClient = new SDKClient(config); | ||
} | ||
|
||
/** | ||
ApiDestination Controller apis: | ||
* createApiDestination * | ||
* updateApiDestination * | ||
* getApiDestination * | ||
* deleteApiDestination * | ||
* listApiDestinations * | ||
*/ | ||
|
||
async function testCreateApiDestination(): void { | ||
var request = new SDKClient.CreateApiDestinationRequest{ | ||
apiDestinationName = "new-api-destination", | ||
connectionName = "new-connection", | ||
description = "demo api destination for test", | ||
httpApiParameters = new SDKClient.CreateApiDestinationRequest.httpApiParameters{ | ||
endpoint = @endpoint, | ||
method = "POST" | ||
} | ||
}; | ||
|
||
try { | ||
var res = @sdkClient.createApiDestination(request); | ||
Console.log(Util.toJSONString(res.body)); | ||
} catch(err) { | ||
Console.log('err!'); | ||
Console.log(err.message); | ||
} finally { | ||
Console.log('test end!'); | ||
} | ||
|
||
} | ||
|
||
async function testUpdateApiDestination(): void { | ||
var request = new SDKClient.UpdateApiDestinationRequest{ | ||
apiDestinationName = "new-api-destination", | ||
connectionName = "new-connection", | ||
description = "!updated! demo api destination for test", | ||
httpApiParameters = new SDKClient.UpdateApiDestinationRequest.httpApiParameters{ | ||
endpoint = @endpoint, | ||
method = "GET" | ||
} | ||
}; | ||
|
||
try { | ||
var res = @sdkClient.updateApiDestination(request); | ||
Console.log(Util.toJSONString(res.body)); | ||
} catch(err) { | ||
Console.log('err!'); | ||
Console.log(err.message); | ||
} finally { | ||
Console.log('test end!'); | ||
} | ||
|
||
} | ||
|
||
async function testGetApiDestination(): void { | ||
var request = new SDKClient.GetApiDestinationRequest{ | ||
apiDestinationName = "new-api-destination" | ||
}; | ||
try { | ||
var res = @sdkClient.getApiDestination(request); | ||
Console.log(Util.toJSONString(res.body)); | ||
} catch(err) { | ||
Console.log('err!'); | ||
Console.log(err.message); | ||
} finally { | ||
Console.log('test end!'); | ||
} | ||
} | ||
|
||
async function testDeleteApiDestination(): void { | ||
var request = new SDKClient.DeleteApiDestinationRequest{ | ||
apiDestinationName = "new-api-destination" | ||
}; | ||
try { | ||
var res = @sdkClient.deleteApiDestination(request); | ||
Console.log(Util.toJSONString(res.body)); | ||
} catch(err) { | ||
Console.log('err!'); | ||
Console.log(err.message); | ||
} finally { | ||
Console.log('test end!'); | ||
} | ||
} | ||
|
||
async function testListApiDestinations(): void { | ||
var request = new SDKClient.ListApiDestinationsRequest{ | ||
maxResults = 2 | ||
}; | ||
|
||
try { | ||
var res = @sdkClient.listApiDestinations(request); | ||
Console.log(Util.toJSONString(res.body)); | ||
} catch(err) { | ||
Console.log('err!'); | ||
Console.log(err.message); | ||
} finally { | ||
Console.log('test end!'); | ||
} | ||
|
||
} |
Oops, something went wrong.