-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from ballerina-platform/kaneel-dev
Add examples
- Loading branch information
Showing
14 changed files
with
900 additions
and
147 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,34 +1,52 @@ | ||
# Examples | ||
|
||
This directory contains a collection of sample code examples written in Ballerina. These examples demonstrate various | ||
use cases of the module. You can follow the instructions below to build and run these examples. | ||
The `aws.sns` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-aws.sns/tree/master/examples), covering use cases like creating an alert service. | ||
|
||
## Running an Example | ||
1. [Weather alert service](https://github.com/ballerina-platform/module-ballerinax-aws.sns/tree/master/examples/weather-alert/main.bal) | ||
Send weather alerts for multiple cities. Users can subscribe to different cities to receive alerts for their city only. | ||
|
||
## Prerequisites | ||
|
||
Execute the following commands to build an example from the source. | ||
1. Follow the [instructions](https://github.com/ballerina-platform/module-ballerinax-aws.sns#set-up-aws-sns-api) to set up the AWS SNS API. | ||
|
||
* To build an example | ||
2. For each example, create a `Config.toml` file with your access key ID, secret access key, and region. Here's an example of how your Config.toml` file should look: | ||
|
||
`bal build <example-name>` | ||
```toml | ||
accessKeyId = "<your-access-key-id>" | ||
secretAccessKey = "<your-secret-access-key" | ||
region = "<aws-instance-region>" | ||
``` | ||
|
||
## Running an Example | ||
|
||
* To run an example | ||
Execute the following commands to build an example from the source: | ||
|
||
`bal run <example-name>` | ||
* To build an example: | ||
|
||
## Building the Examples with the Local Module | ||
```bash | ||
bal build | ||
``` | ||
|
||
**Warning**: Because of the absence of support for reading local repositories for single Ballerina files, the bala of | ||
the module is manually written to the central repository as a workaround. Consequently, the bash script may modify your | ||
local Ballerina repositories. | ||
* To run an example: | ||
|
||
```bash | ||
bal run | ||
``` | ||
|
||
## Building the Examples with the Local Module | ||
|
||
Execute the following commands to build all the examples against the changes you have made to the module locally. | ||
**Warning**: Due to the absence of support for reading local repositories for single Ballerina files, the Bala of the module is manually written to the central repository as a workaround. Consequently, the bash script may modify your local Ballerina repositories. | ||
|
||
* To build all the examples | ||
Execute the following commands to build all the examples against the changes you have made to the module locally: | ||
|
||
`./build.sh build` | ||
* To build all the examples: | ||
|
||
```bash | ||
./build.sh build | ||
``` | ||
|
||
* To run all the examples | ||
* To run all the examples: | ||
|
||
`./build.sh run` | ||
```bash | ||
./build.sh run | ||
``` |
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
[package] | ||
org = "wso2" | ||
name = "football_scores" | ||
version = "0.1.0" | ||
distribution = "2201.8.2" | ||
|
||
[[dependency]] | ||
org = "ballerinax" | ||
name = "aws.sns" | ||
version = "3.0.0" | ||
repository = "local" |
Oops, something went wrong.