wetware / pkg

Peer-to-peer cloud environment
https://wetware.run
Other
38 stars 7 forks source link

Cleanup boot logic #150

Closed lthibault closed 1 year ago

lthibault commented 1 year ago

This PR cleans up the bootstrapping logic for v0.1.0.

Currently, guest code can fetch a host.Host capability from the environment by calling guest/system.Boot(). This adds an equivalent system for host code, with its own implementation of Boot.

In both cases, the Boot functions take a type parameter: a bootstrap client. We can now enforce correct typing of the bootstrap capability: notice how system.Boot[host.Host] is distinct from system.Boot[auth.Provider].

@mikelsr This is a small PR. Technical feedback is most welcome :)