Skip to content

Commit

Permalink
feat(types): Renames guest config to just plain simple config
Browse files Browse the repository at this point in the history
In many of the interfaces out there right now, we've moved more towards
just calling these things config

Signed-off-by: Taylor Thomas <[email protected]>
  • Loading branch information
thomastaylor312 committed Jun 12, 2024
1 parent d491285 commit 536043d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 39 deletions.
19 changes: 9 additions & 10 deletions imports-request-reply.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<p><a name="error.unauthorized"></a><code>unauthorized</code></p>
<p>The requested option is not authorized. This could be a topic it doesn't have
permission to subscribe to, or a permission it doesn't have to perform a specific
action. This error is mainly used when calling `update-guest-configuration`.
action. This error is mainly used when calling `update-config`.
</li>
<li>
<p><a name="error.timeout"></a><code>timeout</code></p>
Expand All @@ -43,12 +43,11 @@ action. This error is mainly used when calling `update-guest-configuration`.
- publish-subscribe channel, which is a broadcast channel, and
- point-to-point channel, which is a unicast channel.
<p>The interface doesn't highlight this difference in the type itself as that's uniquely a consumer issue.</p>
<h4><a name="guest_configuration"></a><code>record guest-configuration</code></h4>
<p>Configuration includes a required list of channels the guest is subscribing to, and an
optional list of extensions key-value pairs</p>
<h4><a name="config"></a><code>record config</code></h4>
<p>Configuration includes a required list of channels the guest is subscribing to</p>
<h5>Record Fields</h5>
<ul>
<li><a name="guest_configuration.channels"></a><code>channels</code>: list&lt;<a href="#channel"><a href="#channel"><code>channel</code></a></a>&gt;</li>
<li><a name="config.channels"></a><code>channels</code>: list&lt;<a href="#channel"><a href="#channel"><code>channel</code></a></a>&gt;</li>
</ul>
<h4><a name="message"></a><code>resource message</code></h4>
<h2>A message with a binary payload and additional information</h2>
Expand Down Expand Up @@ -268,12 +267,12 @@ override the channel/topic in the message.</p>
<h4><a name="error"></a><code>type error</code></h4>
<p><a href="#error"><a href="#error"><code>error</code></a></a></p>
<p>
#### <a name="guest_configuration"></a>`type guest-configuration`
[`guest-configuration`](#guest_configuration)
#### <a name="config"></a>`type config`
[`config`](#config)
<p>
----
<h3>Functions</h3>
<h4><a name="update_guest_configuration"></a><code>update-guest-configuration: func</code></h4>
<h4><a name="update_config"></a><code>update-config: func</code></h4>
<p>'Fit-all' type function for updating a guest's configuration – this could be useful for:</p>
<ul>
<li>unsubscribing from a channel,</li>
Expand All @@ -288,9 +287,9 @@ should validate that the configured topics are valid topics the guest should hav
enforce it via the credentials used to connect to the service.</p>
<h5>Params</h5>
<ul>
<li><a name="update_guest_configuration.gc"></a><code>gc</code>: <a href="#guest_configuration"><a href="#guest_configuration"><code>guest-configuration</code></a></a></li>
<li><a name="update_config.gc"></a><code>gc</code>: <a href="#config"><a href="#config"><code>config</code></a></a></li>
</ul>
<h5>Return values</h5>
<ul>
<li><a name="update_guest_configuration.0"></a> result&lt;_, <a href="#error"><a href="#error"><code>error</code></a></a>&gt;</li>
<li><a name="update_config.0"></a> result&lt;_, <a href="#error"><a href="#error"><code>error</code></a></a>&gt;</li>
</ul>
19 changes: 9 additions & 10 deletions imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<p><a name="error.unauthorized"></a><code>unauthorized</code></p>
<p>The requested option is not authorized. This could be a topic it doesn't have
permission to subscribe to, or a permission it doesn't have to perform a specific
action. This error is mainly used when calling `update-guest-configuration`.
action. This error is mainly used when calling `update-config`.
</li>
<li>
<p><a name="error.timeout"></a><code>timeout</code></p>
Expand All @@ -42,12 +42,11 @@ action. This error is mainly used when calling `update-guest-configuration`.
- publish-subscribe channel, which is a broadcast channel, and
- point-to-point channel, which is a unicast channel.
<p>The interface doesn't highlight this difference in the type itself as that's uniquely a consumer issue.</p>
<h4><a name="guest_configuration"></a><code>record guest-configuration</code></h4>
<p>Configuration includes a required list of channels the guest is subscribing to, and an
optional list of extensions key-value pairs</p>
<h4><a name="config"></a><code>record config</code></h4>
<p>Configuration includes a required list of channels the guest is subscribing to</p>
<h5>Record Fields</h5>
<ul>
<li><a name="guest_configuration.channels"></a><code>channels</code>: list&lt;<a href="#channel"><a href="#channel"><code>channel</code></a></a>&gt;</li>
<li><a name="config.channels"></a><code>channels</code>: list&lt;<a href="#channel"><a href="#channel"><code>channel</code></a></a>&gt;</li>
</ul>
<h4><a name="message"></a><code>resource message</code></h4>
<h2>A message with a binary payload and additional information</h2>
Expand Down Expand Up @@ -223,12 +222,12 @@ override the channel/topic in the message.</p>
<h4><a name="error"></a><code>type error</code></h4>
<p><a href="#error"><a href="#error"><code>error</code></a></a></p>
<p>
#### <a name="guest_configuration"></a>`type guest-configuration`
[`guest-configuration`](#guest_configuration)
#### <a name="config"></a>`type config`
[`config`](#config)
<p>
----
<h3>Functions</h3>
<h4><a name="update_guest_configuration"></a><code>update-guest-configuration: func</code></h4>
<h4><a name="update_config"></a><code>update-config: func</code></h4>
<p>'Fit-all' type function for updating a guest's configuration – this could be useful for:</p>
<ul>
<li>unsubscribing from a channel,</li>
Expand All @@ -243,9 +242,9 @@ should validate that the configured topics are valid topics the guest should hav
enforce it via the credentials used to connect to the service.</p>
<h5>Params</h5>
<ul>
<li><a name="update_guest_configuration.gc"></a><code>gc</code>: <a href="#guest_configuration"><a href="#guest_configuration"><code>guest-configuration</code></a></a></li>
<li><a name="update_config.gc"></a><code>gc</code>: <a href="#config"><a href="#config"><code>config</code></a></a></li>
</ul>
<h5>Return values</h5>
<ul>
<li><a name="update_guest_configuration.0"></a> result&lt;_, <a href="#error"><a href="#error"><code>error</code></a></a>&gt;</li>
<li><a name="update_config.0"></a> result&lt;_, <a href="#error"><a href="#error"><code>error</code></a></a>&gt;</li>
</ul>
23 changes: 11 additions & 12 deletions messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<p><a name="error.unauthorized"></a><code>unauthorized</code></p>
<p>The requested option is not authorized. This could be a topic it doesn't have
permission to subscribe to, or a permission it doesn't have to perform a specific
action. This error is mainly used when calling `update-guest-configuration`.
action. This error is mainly used when calling `update-config`.
</li>
<li>
<p><a name="error.timeout"></a><code>timeout</code></p>
Expand All @@ -47,12 +47,11 @@ action. This error is mainly used when calling `update-guest-configuration`.
- publish-subscribe channel, which is a broadcast channel, and
- point-to-point channel, which is a unicast channel.
<p>The interface doesn't highlight this difference in the type itself as that's uniquely a consumer issue.</p>
<h4><a name="guest_configuration"></a><code>record guest-configuration</code></h4>
<p>Configuration includes a required list of channels the guest is subscribing to, and an
optional list of extensions key-value pairs</p>
<h4><a name="config"></a><code>record config</code></h4>
<p>Configuration includes a required list of channels the guest is subscribing to</p>
<h5>Record Fields</h5>
<ul>
<li><a name="guest_configuration.channels"></a><code>channels</code>: list&lt;<a href="#channel"><a href="#channel"><code>channel</code></a></a>&gt;</li>
<li><a name="config.channels"></a><code>channels</code>: list&lt;<a href="#channel"><a href="#channel"><code>channel</code></a></a>&gt;</li>
</ul>
<h4><a name="message"></a><code>resource message</code></h4>
<h2>A message with a binary payload and additional information</h2>
Expand Down Expand Up @@ -228,12 +227,12 @@ override the channel/topic in the message.</p>
<h4><a name="error"></a><code>type error</code></h4>
<p><a href="#error"><a href="#error"><code>error</code></a></a></p>
<p>
#### <a name="guest_configuration"></a>`type guest-configuration`
[`guest-configuration`](#guest_configuration)
#### <a name="config"></a>`type config`
[`config`](#config)
<p>
----
<h3>Functions</h3>
<h4><a name="update_guest_configuration"></a><code>update-guest-configuration: func</code></h4>
<h4><a name="update_config"></a><code>update-config: func</code></h4>
<p>'Fit-all' type function for updating a guest's configuration – this could be useful for:</p>
<ul>
<li>unsubscribing from a channel,</li>
Expand All @@ -248,20 +247,20 @@ should validate that the configured topics are valid topics the guest should hav
enforce it via the credentials used to connect to the service.</p>
<h5>Params</h5>
<ul>
<li><a name="update_guest_configuration.gc"></a><code>gc</code>: <a href="#guest_configuration"><a href="#guest_configuration"><code>guest-configuration</code></a></a></li>
<li><a name="update_config.gc"></a><code>gc</code>: <a href="#config"><a href="#config"><code>config</code></a></a></li>
</ul>
<h5>Return values</h5>
<ul>
<li><a name="update_guest_configuration.0"></a> result&lt;_, <a href="#error"><a href="#error"><code>error</code></a></a>&gt;</li>
<li><a name="update_config.0"></a> result&lt;_, <a href="#error"><a href="#error"><code>error</code></a></a>&gt;</li>
</ul>
<h2><a name="wasi:messaging_guest_0.2.0_draft"></a>Export interface wasi:messaging/[email protected]</h2>
<hr />
<h3>Types</h3>
<h4><a name="message"></a><code>type message</code></h4>
<p><a href="#message"><a href="#message"><code>message</code></a></a></p>
<p>
#### <a name="guest_configuration"></a>`type guest-configuration`
[`guest-configuration`](#guest_configuration)
#### <a name="config"></a>`type config`
[`config`](#config)
<p>
#### <a name="error"></a>`type error`
[`error`](#error)
Expand Down
4 changes: 2 additions & 2 deletions wit/consumer.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// The consumer interface allows a guest to dynamically update its subscriptions and configuration
interface consumer {
use types.{error, guest-configuration};
use types.{error, config};

/// 'Fit-all' type function for updating a guest's configuration – this could be useful for:
/// - unsubscribing from a channel,
Expand All @@ -13,5 +13,5 @@ interface consumer {
/// to resources that are not intended to be accessible to the guest. This means implementations
/// should validate that the configured topics are valid topics the guest should have access to or
/// enforce it via the credentials used to connect to the service.
update-guest-configuration: func(gc: guest-configuration) -> result<_, error>;
update-config: func(gc: config) -> result<_, error>;
}
2 changes: 1 addition & 1 deletion wit/guest.wit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
interface guest {
use types.{message, guest-configuration, error};
use types.{message, config, error};

/// Whenever this guest receives a message in one of the subscribed channels, the message is
/// sent to this handler. The guest is responsible for matching on the channel and handling the
Expand Down
7 changes: 3 additions & 4 deletions wit/types.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface types {
variant error {
/// The requested option is not authorized. This could be a topic it doesn't have
/// permission to subscribe to, or a permission it doesn't have to perform a specific
/// action. This error is mainly used when calling `update-guest-configuration`.
/// action. This error is mainly used when calling `update-config`.
unauthorized,
/// The request or operation timed out.
timeout,
Expand All @@ -25,9 +25,8 @@ interface types {
/// The interface doesn't highlight this difference in the type itself as that's uniquely a consumer issue.
type channel = string;

/// Configuration includes a required list of channels the guest is subscribing to, and an
/// optional list of extensions key-value pairs
record guest-configuration {
/// Configuration includes a required list of channels the guest is subscribing to
record config {
channels: list<channel>,
}

Expand Down

0 comments on commit 536043d

Please sign in to comment.