Skip to content

Commit b79a4b3

Browse files
committed
Add PACKAGE.md for CloudNative.CloudEvents
Signed-off-by: Safia Abdalla <[email protected]>
1 parent b4632f4 commit b79a4b3

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

src/CloudNative.CloudEvents/CloudNative.CloudEvents.csproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<LangVersion>latest</LangVersion>
77
<Nullable>enable</Nullable>
88
<PackageTags>cloudnative;cloudevents;events</PackageTags>
9+
<PackageReadmeFile>PACKAGE.md</PackageReadmeFile>
910
</PropertyGroup>
1011

1112
<ItemGroup>
@@ -29,5 +30,8 @@
2930
</EmbeddedResource>
3031
</ItemGroup>
3132

32-
</Project>
33+
<ItemGroup>
34+
<None Include="PACKAGE.md" Pack="true" PackagePath="\"/>
35+
</ItemGroup>
3336

37+
</Project>
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## About
2+
3+
CloudNative.CloudEvents is a NuGet package that provides support for creating, encoding, decoding, sending, and receiving CNCF CloudEvents.
4+
5+
## Key Features
6+
7+
* Supports constructing a spec-compliant CloudEvent
8+
* Provides abstractions for building custom CloudEvent formatters
9+
10+
## How to Use
11+
12+
To start using the CloudNative.CloudEvents package in a .NET application, follow these steps:
13+
14+
### Installation
15+
16+
```sh
17+
dotnet add package CloudNative.CloudEvents
18+
```
19+
20+
### Configuration
21+
22+
In the application of your choosing, construct a `CloudEvent` as follows:
23+
24+
```C#
25+
using CloudNative.CloudEvents;
26+
27+
CloudEvent cloudEvent = new CloudEvent
28+
{
29+
Id = "event-id",
30+
Type = "event-type",
31+
Source = new Uri("https://cloudevents.io/"),
32+
Time = DateTimeOffset.UtcNow,
33+
DataContentType = "text/plain",
34+
Data = "This is CloudEvent data"
35+
};
36+
```
37+
38+
This package only provides the abstractions for constructing a CloudEvent. For complete deserialization and serialization behavior, you will need to use an accompanying formatter library. For more information on configuring and using CloudNative.CloudEvents, refer to the [official documentation](https://github.com/cloudevents/sdk-csharp/tree/main/docs).
39+
40+
## Main Types
41+
42+
The main types provided by this library are:
43+
44+
* `CloudEvent`: Represents a spec-compliant CloudEvent.
45+
* `CloudEventFormatter`: Provides an abstract class that can be extended to implement an event formatter.
46+
47+
## Feedback & Contributing
48+
49+
CloudNative.CloudEvents is released as open-source under the [Apache license](https://licenses.nuget.org/Apache-2.0). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/cloudevents/sdk-csharp).

0 commit comments

Comments
 (0)