Skip to content

Commit

Permalink
Merge pull request #2 from VivoxaLabs/master
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
chamodshehanka authored Apr 18, 2019
2 parents e0aa7ca + 86abe4d commit 7e57c7f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 46 deletions.
20 changes: 2 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# balvalidate
Validator for ballerina
Basic data validator module for Ballerina

## Compatibility
| Ballerina Language Version | API version |
Expand All @@ -10,26 +10,10 @@ Validator for ballerina
The following sections provide you with information on how to use the Ballerina Twitter connector.

- [Contribute To Develop](#contribute-to-develop)
- [Working with Twitter Connector actions](#working-with-twitter-connector-actions)
- [Example](#example)

### Contribute To develop
## Contribute To develop

Clone the repository by running the following command
```shell
git clone https://github.com/VivoxaLabs/balvalidate.git
```


```ballerina
```

##### Example

```ballerina
import ballerina/io;
import wso2/twitter;
```
17 changes: 17 additions & 0 deletions bal.validate/validator.bal
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

// This module is used for validating data.

// ToDo:
// Add validation methods for
// String, Integer, Email Addr etc.

import ballerina/io;


// sample func, not implemeted yet
public function isValidInteger() returns boolean {
return true;
}



25 changes: 25 additions & 0 deletions balvalidate_test.bal
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import ballerina/http;
import ballerina/io;

import bal.validate;

service hello on new http:Listener(9090) {

resource function sayHello(http:Caller caller, http:Request request) {

http:Response response = new;

response.setTextPayload("Hello Ballerina!");



_ = caller -> respond(response);
}
}


public function main() {

// calling validator
io:println(validate:isValidInteger());
}
28 changes: 0 additions & 28 deletions hello_service.bal

This file was deleted.

0 comments on commit 7e57c7f

Please sign in to comment.