Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dir: [consent-management, data-collection]
dir: [edge-function, data-collection]
defaults:
run:
working-directory: ${{ matrix.dir }}
Expand Down
46 changes: 0 additions & 46 deletions consent-management/Component.cs

This file was deleted.

File renamed without changes.
30 changes: 30 additions & 0 deletions edge-function/Component.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace EdgeFunctionWorld.wit.exports.wasi.http.v0_2_0;
using System.Text;

using EdgeFunctionWorld;
using EdgeFunctionWorld.wit.exports.wasi.http.v0_2_0;
using EdgeFunctionWorld.wit.imports.wasi.http.v0_2_0;
using EdgeFunctionWorld.wit.imports.wasi.io.v0_2_0;

public class IncomingHandlerImpl: IIncomingHandler {
public static void Handle(ITypes.IncomingRequest request, ITypes.ResponseOutparam responseOut) {
byte[] content = "Hello, World!"u8.ToArray();
List<(string, byte[])> headers =
[
("content-type", "text/plain"u8.ToArray()),
("content-length", Encoding.ASCII.GetBytes(content.Length.ToString()))
];

ITypes.OutgoingResponse response = new(ITypes.Fields.FromList(headers));
ITypes.OutgoingBody body = response.Body();

ITypes.ResponseOutparam.Set(responseOut, Result<ITypes.OutgoingResponse, ITypes.ErrorCode>.Ok(response));

using IStreams.OutputStream stream = body.Write();
stream.BlockingWriteAndFlush(content);
stream.Dispose();

ITypes.OutgoingBody.Finish(body, null);
}
}

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
manifest-version = 1

[component]
name = "example-cs-consent-management-component"
name = "example-cs-edge-function-component"
version = "1.0.0"
category = "consent-management"
subcategory = "consent-mapping"
description = "Example CSharp component for consent management"
category = "edge-function"
subcategory = "analytics"
description = "Example CSharp component for edge-function"
documentation = "https://github.com/edgee-cloud/example-cs-component"
repository = "https://github.com/edgee-cloud/example-cs-component"
language = "CSharp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<ItemGroup>
<Wit Remove="**\*.wit" />
<Wit Include=".edgee/wit" World="consent-management" />
<Wit Include=".edgee/wit" World="edge-function" />
</ItemGroup>

</Project>
File renamed without changes.