MCPcopy Index your code
hub / github.com/crossplane/function-template-go

github.com/crossplane/function-template-go @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
12 symbols 38 edges 6 files 8 documented · 67%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

function-template-go

CI

A template for writing a composition function in Go.

To learn how to use this template:

If you just want to jump in and get started:

  1. Replace function-template-go with your function in go.mod, package/crossplane.yaml, and any Go imports. (You can also do this automatically by running the ./init.sh <function-name> script.)
  2. Update input/v1beta1/ to reflect your desired input (and run go generate ./...)
  3. Add your logic to RunFunction in fn.go
  4. Add tests for your logic in fn_test.go
  5. Update this file, README.md, to be about your function!

This template uses Go, Docker, and the Crossplane CLI to build functions.

# Run code generation - see input/generate.go
$ go generate ./...

# Run tests - see fn_test.go
$ go test ./...

# Build the function's runtime image - see Dockerfile
$ docker build . --tag=runtime

# Build a function package - see package/crossplane.yaml
$ crossplane xpkg build -f package --embed-runtime-image=runtime

Core symbols most depended-on inside this repo

Run
called by 2
main.go
RunFunction
called by 1
fn.go
main
called by 0
main.go

Shape

Method 5
Struct 5
Function 2

Languages

Go100%

Modules by API surface

main.go3 symbols
input/v1beta1/zz_generated.deepcopy.go3 symbols
fn_test.go3 symbols
fn.go2 symbols
input/v1beta1/input.go1 symbols

For agents

$ claude mcp add function-template-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact