refraction-networking / water

WebAssembly Transport Executables Runtime
Apache License 2.0
25 stars 1 forks source link

feat: construct `Config` from serializable data #19

Closed gaukas closed 8 months ago

gaukas commented 8 months ago

It would be feasible to provide a method allowing (partially) constructing Config from a file/stream of bytes/human-readable text string input, or other types of serializable data.

We will need a new ~type~ package, ~ConfigBuilder~ internal/configbuilder, ~as~ which provide ~an~ interface(s) supporting building Config from serializable data.

Candidate Formats:

erikziyunchi commented 8 months ago

On the rust side, we have something like this for now used in v1_preview.

gaukas commented 8 months ago

Thanks @erikziyunchi. I think the link you provided is a different thing, it looks like an internal config used between Rust WATER runtime and the WebAssembly Transport Module.

What I was describing here however, is a way allowing user to let's say "download" a config for Go WATER runtime otherwise. The Config I have been talking about is defined as below which is used to config the host capabilities for the most part (except for the TransportModuleConfig I guess):

https://github.com/gaukas/water/blob/8e8f2a460e3df10b7c317557e3b9955cbdfd2aac/config.go#L11-L47