Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lionelvillard/knative-functions
A collection of Knative functions
https://github.com/lionelvillard/knative-functions
Last synced: 23 days ago
JSON representation
A collection of Knative functions
- Host: GitHub
- URL: https://github.com/lionelvillard/knative-functions
- Owner: lionelvillard
- License: apache-2.0
- Created: 2019-07-30T14:43:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-03T21:47:49.000Z (over 2 years ago)
- Last Synced: 2023-03-03T12:23:50.876Z (over 1 year ago)
- Language: JavaScript
- Size: 15.7 MB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Knative Eventing Functions
[![Build Status](https://travis-ci.org/lionelvillard/knative-functions.svg?branch=master)](https://travis-ci.org/lionelvillard/knative-functions)This project provides a collection of functions manipulating [Cloud Events](https://cloudevents.io).
All functions are currently only _callable_ (synchronous). We are planning to add _composable_ (asynchronous) functions
the near future.## Installation
You first need to install the [Knative Eventing Function Controller](https://github.com/lionelvillard/knative-functions-controller):
```sh
kubectl apply -f https://github.com/lionelvillard/knative-functions-controller/releases/download/v0.1.2/function.yaml
```Then install the function library:
```sh
kubectl apply -f https://github.com/lionelvillard/knative-functions/releases/download/v0.2.0/functions.yaml
```## Functions
The functions are:
- [Wait](#wait)
- [Filter](#filter)### Wait
The `Wait` function forward events after X seconds.
#### Example
```yaml
apiVersion: functions.knative.dev/v1alpha1
kind: Wait
metadata:
name: wait-5
spec:
seconds: 5
```### Filter
A filter takes a cloud event as input, evaluates a predicate against it and returns the
unmodified event when the predicate return true, otherwise returns an empty response.The predicate must be a Javascript expression. It is evaluated in a sandbox with the variable [`event`](https://github.com/cloudevents/spec/blob/v1.0/json-format.md)
### Example
```yaml
apiVersion: functions.knative.dev/v1alpha1
kind: Filter
metadata:
name: filter
spec:
expression: event.data.assigned
```