pub struct Trigger {
pub id: String,
pub component: Option<ComponentSpec>,
pub components: IndexMap<String, OneOrManyComponentSpecs>,
pub config: Table,
}
Expand description
Trigger configuration. A trigger maps an event of the trigger’s type (e.g.
an HTTP request on route /shop
, a Redis message on channel orders
) to
a Spin component.
The trigger manifest contains additional fields which depend on the trigger
type. For the http
type, these additional fields are route
(required) and
executor
(optional). For the redis
type, the additional fields are
channel
(required) and address
(optional). For other types, see the trigger
documentation.
Learn more: https://spinframework.dev/http-trigger, https://spinframework.dev/redis-trigger
Fields§
§id: String
Optional identifier for the trigger.
Example: id = "trigger-id"
component: Option<ComponentSpec>
The component that Spin should run when the trigger occurs. For HTTP triggers,
this is the HTTP request handler for the trigger route. This is typically
the ID of an entry in the [component]
table, although you can also write
the component out as the value of this field.
Example: component = "shop-handler"
Learn more: https://spinframework.dev/triggers#triggers-and-components
components: IndexMap<String, OneOrManyComponentSpecs>
Reserved for future use.
components = { ... }
config: Table
Opaque trigger-type-specific config