https://github.com/negz/function-git-trail
https://github.com/negz/function-git-trail
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/negz/function-git-trail
- Owner: negz
- License: apache-2.0
- Created: 2024-03-29T22:08:45.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-29T22:08:47.000Z (about 1 year ago)
- Last Synced: 2025-01-25T22:35:28.566Z (4 months ago)
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# function-template-go
[](https://github.com/crossplane/function-template-go/actions/workflows/ci.yml)A template for writing a [composition function][functions] in [Go][go].
To learn how to use this template:
* [Follow the guide to writing a composition function in Go][function guide]
* [Learn about how composition functions work][functions]
* [Read the function-sdk-go package documentation][package docs]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 ` script.)
1. Update `input/v1beta1/` to reflect your desired input (and run `go generate`)
1. Add your logic to `RunFunction` in `fn.go`
1. Add tests for your logic in `fn_test.go`
1. Update this file, `README.md`, to be about your function!This template uses [Go][go], [Docker][docker], and the [Crossplane CLI][cli] to
build functions.```shell
# 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
```[functions]: https://docs.crossplane.io/latest/concepts/composition-functions
[go]: https://go.dev
[function guide]: https://docs.crossplane.io/knowledge-base/guides/write-a-composition-function-in-go
[package docs]: https://pkg.go.dev/github.com/crossplane/function-sdk-go
[docker]: https://www.docker.com
[cli]: https://docs.crossplane.io/latest/cli