-
Notifications
You must be signed in to change notification settings - Fork 2
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 #6 from Nuvindu/docs
Change EOF format to LF in files
- Loading branch information
Showing
8 changed files
with
1,945 additions
and
1,945 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 |
---|---|---|
@@ -1,46 +1,46 @@ | ||
## Overview | ||
|
||
Avro is an open-source data serialization system that enables efficient binary serialization and deserialization. It allows users to define schemas for structured data, providing better representation and fast serialization/deserialization. Avro's schema evolution capabilities ensure compatibility and flexibility in evolving data systems. | ||
|
||
The Ballerina Avro module provides the capability to efficiently serialize and deserialize data using Avro schemas. | ||
|
||
## Schema | ||
|
||
The `Schema` instance accepts an Avro schema in `string` format. If the provided schema is not valid according to Avro, an error is returned. The client can be used to serialize data into bytes using the defined schema and deserialize the bytes back to the correct data type based on the schema. | ||
|
||
A `Schema` can be defined using the `string` value of an Avro schema as shown below. | ||
|
||
```ballerina | ||
avro:Schema schema = check new(string `{"type": "int", "namespace": "example.data" }`); | ||
``` | ||
|
||
### APIs associated with Avro | ||
|
||
- **toAvro**: Serializes the given data according to the Avro format. | ||
- **fromAvro**: Deserializes the given Avro encoded message to the given data type. | ||
|
||
#### `toAvro` | ||
|
||
Serializes the given data according to the Avro format. | ||
|
||
```ballerina | ||
import ballerina/avro; | ||
public function main() returns error? { | ||
int value = 5; | ||
byte[] serializeData = check schema.toAvro(value); | ||
} | ||
``` | ||
|
||
#### `fromAvro` | ||
|
||
Deserializes the given Avro encoded message to the given data type. | ||
|
||
```ballerina | ||
import ballerina/avro; | ||
public function main() returns error? { | ||
byte[] data = // Avro encoded message ; | ||
int deserializeData = check schema.fromAvro(data); | ||
} | ||
``` | ||
## Overview | ||
|
||
Avro is an open-source data serialization system that enables efficient binary serialization and deserialization. It allows users to define schemas for structured data, providing better representation and fast serialization/deserialization. Avro's schema evolution capabilities ensure compatibility and flexibility in evolving data systems. | ||
|
||
The Ballerina Avro module provides the capability to efficiently serialize and deserialize data using Avro schemas. | ||
|
||
## Schema | ||
|
||
The `Schema` instance accepts an Avro schema in `string` format. If the provided schema is not valid according to Avro, an error is returned. The client can be used to serialize data into bytes using the defined schema and deserialize the bytes back to the correct data type based on the schema. | ||
|
||
A `Schema` can be defined using the `string` value of an Avro schema as shown below. | ||
|
||
```ballerina | ||
avro:Schema schema = check new(string `{"type": "int", "namespace": "example.data" }`); | ||
``` | ||
|
||
### APIs associated with Avro | ||
|
||
- **toAvro**: Serializes the given data according to the Avro format. | ||
- **fromAvro**: Deserializes the given Avro encoded message to the given data type. | ||
|
||
#### `toAvro` | ||
|
||
Serializes the given data according to the Avro format. | ||
|
||
```ballerina | ||
import ballerina/avro; | ||
public function main() returns error? { | ||
int value = 5; | ||
byte[] serializeData = check schema.toAvro(value); | ||
} | ||
``` | ||
|
||
#### `fromAvro` | ||
|
||
Deserializes the given Avro encoded message to the given data type. | ||
|
||
```ballerina | ||
import ballerina/avro; | ||
public function main() returns error? { | ||
byte[] data = // Avro encoded message ; | ||
int deserializeData = check schema.fromAvro(data); | ||
} | ||
``` |
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,46 +1,46 @@ | ||
## Package overview | ||
|
||
Avro is an open-source data serialization system that enables efficient binary serialization and deserialization. It allows users to define schemas for structured data, providing better representation and fast serialization/deserialization. Avro's schema evolution capabilities ensure compatibility and flexibility in evolving data systems. | ||
|
||
The Ballerina Avro module provides the capability to efficiently serialize and deserialize data using Avro schemas. | ||
|
||
## Schema | ||
|
||
The `Schema` instance accepts an Avro schema in `string` format. If the provided schema is not valid according to Avro, an error is returned. The client can be used to serialize data into bytes using the defined schema and deserialize the bytes back to the correct data type based on the schema. | ||
|
||
A `Schema` can be defined using the `string` value of an Avro schema as shown below. | ||
|
||
```ballerina | ||
avro:Schema schema = check new(string `{"type": "int", "namespace": "example.data" }`); | ||
``` | ||
|
||
### APIs associated with Avro | ||
|
||
- **toAvro**: Serializes the given data according to the Avro format. | ||
- **fromAvro**: Deserializes the given Avro encoded message to the given data type. | ||
|
||
#### `toAvro` | ||
|
||
Serializes the given data according to the Avro format. | ||
|
||
```ballerina | ||
import ballerina/avro; | ||
public function main() returns error? { | ||
int value = 5; | ||
byte[] serializeData = check schema.toAvro(value); | ||
} | ||
``` | ||
|
||
#### `fromAvro` | ||
|
||
Deserializes the given Avro encoded message to the given data type. | ||
|
||
```ballerina | ||
import ballerina/avro; | ||
public function main() returns error? { | ||
byte[] data = // Avro encoded message ; | ||
int deserializeData = check schema.fromAvro(data); | ||
} | ||
``` | ||
## Package overview | ||
|
||
Avro is an open-source data serialization system that enables efficient binary serialization and deserialization. It allows users to define schemas for structured data, providing better representation and fast serialization/deserialization. Avro's schema evolution capabilities ensure compatibility and flexibility in evolving data systems. | ||
|
||
The Ballerina Avro module provides the capability to efficiently serialize and deserialize data using Avro schemas. | ||
|
||
## Schema | ||
|
||
The `Schema` instance accepts an Avro schema in `string` format. If the provided schema is not valid according to Avro, an error is returned. The client can be used to serialize data into bytes using the defined schema and deserialize the bytes back to the correct data type based on the schema. | ||
|
||
A `Schema` can be defined using the `string` value of an Avro schema as shown below. | ||
|
||
```ballerina | ||
avro:Schema schema = check new(string `{"type": "int", "namespace": "example.data" }`); | ||
``` | ||
|
||
### APIs associated with Avro | ||
|
||
- **toAvro**: Serializes the given data according to the Avro format. | ||
- **fromAvro**: Deserializes the given Avro encoded message to the given data type. | ||
|
||
#### `toAvro` | ||
|
||
Serializes the given data according to the Avro format. | ||
|
||
```ballerina | ||
import ballerina/avro; | ||
public function main() returns error? { | ||
int value = 5; | ||
byte[] serializeData = check schema.toAvro(value); | ||
} | ||
``` | ||
|
||
#### `fromAvro` | ||
|
||
Deserializes the given Avro encoded message to the given data type. | ||
|
||
```ballerina | ||
import ballerina/avro; | ||
public function main() returns error? { | ||
byte[] data = // Avro encoded message ; | ||
int deserializeData = check schema.fromAvro(data); | ||
} | ||
``` |
Oops, something went wrong.