Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename manifest fields, add example setting #4

Merged
merged 2 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 11 additions & 9 deletions dc_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ class DataCollection(exports.DataCollection):
'''
def page(self, e: data_collection.Event, settings: List[Tuple[str, str]]) -> data_collection.EdgeeRequest:
'''
settings is a list of tuple, which contains each key and secret for the provider
for example, if your component is set to use
[[components.data_collection]]
name = "my_component"
component = "outpout.wasm"
settings.test_project_id = "123456789"
settings.test_write_key = "abcdefg"

settings will be [("test_project_id", "123456789"), ("test_write_key", "abcdefg")]
settings is a list of tuple, which contains each key and value for the provider
for example, if your component define this setting:

[component.settings.example]
title = "Example Config Field"
type = "string"

settings will be [("example", "value")], so you can access its value as follows:

example_value = dict(settings)['example']

'''
'''
the function should return the following:
Expand Down
8 changes: 6 additions & 2 deletions edgee-component.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
manifest_version = 1

[package]
[component]
name = "example-py-component"
version = "1.0.0"
category = "data-collection"
Expand All @@ -10,6 +10,10 @@ documentation = "https://github.com/edgee-cloud/example-py-component"
repository = "https://github.com/edgee-cloud/example-py-component"
wit-world-version = "0.4.0"

[package.build]
[component.build]
command = "uv sync && uv run componentize-py --wit-path wit/ bindings edgee_world && uv run componentize-py --wit-path wit/ --world data-collection componentize dc_component -o dc_component.wasm"
output_path = "./dc_component.wasm"

[component.settings.example]
title = "Example Config Field"
type = "string"