Crates.io | kubeless |
lib.rs | kubeless |
version | 0.1.3 |
source | src |
created_at | 2018-06-30 15:44:08.36975 |
updated_at | 2018-06-30 20:19:04.447384 |
description | A library for writing Kubeless functions |
homepage | |
repository | https://github.com/Slowki/kubeless-rs |
max_upload_size | |
id | 72308 |
size | 11,188 |
A Rust Library for Writing Kubeless Functions.
#[macro_use]
extern crate kubeless;
fn say_hello(event: kubeless::Event, ctx: kubeless::Context) -> String {
match event.data {
Some(name) => format!("Hello, {}", String::from_utf8_lossy(&name)),
None => String::from("Hello"),
}
}
fn say_goodbye(event: kubeless::Event, ctx: kubeless::Context) -> String {
match event.data {
Some(name) => format!("Goodbye, {}", String::from_utf8_lossy(&name)),
None => String::from("Goodbye"),
}
}
fn main() {
kubeless::start(select_function!(say_hello, say_goodbye));
}