Composite Components
This Documentation is a WIP
Example
Simple composite component that echos input back as output
Every component starts off with the common Component kind
and an optional name.
kind: wick/component@v1
name: echo
This example defines 1 operation:
echo
. There is no real logic in composite
operations. They define the flow of data from the input, to other operations, and finally to the output.
The inputs
and outputs
are frequently omitted in composite operations. Their types are inferred from the inputs and outputs they connect to.
operations:
- flow:
- <input>.input -> <output>.output
inputs:
- name: input
type: string
name: echo
outputs:
- name: output
type: string
The full configuration is located at examples/components/echo.wick.
Running on the CLI with wick invoke
Run this component on the command line by cloning the wick repository and using wick invoke
.
Note: Use cargo run -p wick-cli -- invoke
to run wick
from source.
Clone the repository with
git clone https://github.com/candlecorp/wick && cd wick
Notice: the arguments to the operation come after the --
.
Invoke the operation echo
with the following command:
wick invoke examples/components/echo.wick echo -- --input=[...]
Complete Example
The full example configuration is included below,
kind: wick/component@v1
name: echo
metadata:
version: 0.0.1
description: Simple composite component that echos input back as output
licenses:
- Apache-2.0
component:
kind: wick/component/composite@v1
operations:
- name: echo
inputs:
- name: input
type: string
outputs:
- name: output
type: string
flow:
- <input>.input -> <output>.output
tests:
- name: basic
cases:
- name: default
operation: echo
inputs:
- name: input
value: 'Hello, world!'
outputs:
- name: output
value: 'Hello, world!'