Skip to content

ngergs/crossplane-fn-sdk-rs-unofficial

Repository files navigation

crossplane-fn-sdk-rs-unofficial

This is an unofficial Rust composite function sdk for crossplane.

This is a v0 version, breaking changes are common.

Usage

Add the sdk dependency:

cargo add crossplane-fn-sdk-unofficial

The most direct way to implement a composite function would be:

fn composite_function(request: RunFunctionRequest) -> Result<RunFunctionResponse,Status> {
    // Business logic goes here
    Ok(RunFunctionResponse {
        context: request.context,
        meta: Some(request.meta.into_response_meta(60)),
        desired: request.desired,
        ..Default::default()
    })
}

run_server(Args::parse(), composite_function).await?

Docs

For detailed information see the full API documentation.

Alternatively, the examples are a good way to get started.

Compile-time dependencies

The protocol buffer library prost-wkt-types used by the sdk requires protoc at compile-time.

About

Unofficial sdk for implementing Crossplane composite functions in Rust

Resources

License

Stars

Watchers

Forks

Contributors