{"id":30039374,"url":"https://github.com/alitari/ce-go-template","last_synced_at":"2026-05-18T06:38:20.644Z","repository":{"id":55931916,"uuid":"306653009","full_name":"alitari/ce-go-template","owner":"alitari","description":"process CloudEvent with go template","archived":false,"fork":false,"pushed_at":"2020-12-06T13:04:55.000Z","size":214,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T22:37:14.804Z","etag":null,"topics":["cloudevent","cloudevents","go-template","golang","k8s","knative","knative-eventing","kubernetes","sprig-functions"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alitari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-23T13:57:04.000Z","updated_at":"2023-09-08T18:13:58.000Z","dependencies_parsed_at":"2022-08-15T09:40:59.577Z","dependency_job_id":null,"html_url":"https://github.com/alitari/ce-go-template","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/alitari/ce-go-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alitari%2Fce-go-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alitari%2Fce-go-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alitari%2Fce-go-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alitari%2Fce-go-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alitari","download_url":"https://codeload.github.com/alitari/ce-go-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alitari%2Fce-go-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269185745,"owners_count":24374629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudevent","cloudevents","go-template","golang","k8s","knative","knative-eventing","kubernetes","sprig-functions"],"created_at":"2025-08-07T01:42:24.352Z","updated_at":"2025-10-23T02:38:14.153Z","avatar_url":"https://github.com/alitari.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ce-go-template\n\n![build](https://github.com/alitari/ce-go-template/workflows/TestAndBuild/badge.svg)\n![build](https://github.com/alitari/ce-go-template/workflows/PublishImages/badge.svg)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/alitari/ce-go-template?style=plastic)\n[![Go Report Card](https://goreportcard.com/badge/github.com/alitari/ce-go-template)](https://goreportcard.com/report/github.com/alitari/ce-go-template)\n[![codecov](https://codecov.io/gh/alitari/ce-go-template/branch/main/graph/badge.svg)](https://codecov.io/gh/alitari/ce-go-template)\n\n`Ce-go-template` is a collection of services which process a [CloudEvent] with a [go template]. As the go-template includes the [sprig functions] you can use built-in functionality for collections, strings, math, security/encryption, etc. \nA main purpose is to use the services for building [knative eventing](https://knative.dev/docs/eventing/) primitives.\nWe can group the services according to their role in an event processing chain:\n\n| Group | Knative eventing primitives | \n| --- | --- |\n| producers | [ContainerSource],[Sinkbinding] |\n| mappers   | [Sequence],[Parallel],[Sinkbinding] |\n| filters   | [Parallel] |\n\n\n## producers\n\n![producers](http://www.plantuml.com/plantuml/proxy?cache=no\u0026src=https://raw.githubusercontent.com/alitari/ce-go-template/master/docs/iuml/producers.iuml)\n\nGo-Template transforms an input data structure to a cloudEvent and sends them to an [event sink]. In [knative] a producer can be applied as an event source using a [ContainerSource] or a [Sinkbinding]\n\n| producer name | Input | Description |\n| ------------- | ------| ------------|\n| ce-go-template-periodic-producer | void | Sends events frequently based on a configurable time period. See [details](docs/periodic-producer.md)\n| ce-go-template-http-server-producer | HTTP-Request | Sends events based on an incoming http request. See [details](docs/http-server-producer.md) |\n\n\n## mappers\n\nA mapper transforms an incoming CloudEvent to an outgoing CloudEvent. Depending whether an [event sink] is present, the new event is either sent to the sink ( *send mode*), or is the payload of the http response (*reply mode*)\n\n![mappers](http://www.plantuml.com/plantuml/proxy?cache=no\u0026src=https://raw.githubusercontent.com/alitari/ce-go-template/master/docs/iuml/mappers.iuml)\n\n| mapper name | Description |\n| ------------- | ------------|\n| ce-go-template-mapper | Transforms events based on a go-template. See [details](docs/ce-go-template-mapper.md)|\n| ce-go-template-http-client-mapper | Transforms an event to HTTP-Request and sends it to a HTTP server. The response is transformed to the outgoing cloud event. See [details](docs/ce-go-template-http-client-mapper.md) |\n\n\n## filters\n\nA filter replies with the incoming CloudEvent, if a predicate string built by a go-template resolves to \"true\". Otherwise the response has no content. In [knative] a filter can be applied in [Flows] like [Parallel]\n\n![filters](http://www.plantuml.com/plantuml/proxy?cache=no\u0026src=https://raw.githubusercontent.com/alitari/ce-go-template/master/docs/iuml/filters.iuml)\n\n| filter name | Description |\n| ------------- | ------------|\n| ce-go-template-filter | Transforms events to a predicate string based on a go-template. See [details](docs/ce-go-template-filter.md)|\n| ce-go-template-http-client-filter | Transforms an event to HTTP-Request and sends it to a HTTP server. The response is transformed to the outgoing cloud event. See [details](docs/ce-go-template-http-client-mapper.md) |\n\n\n## deployment options in [knative]\n\n### event producer as container source\n\n```bash\n# create event display\nkn service create event-display --image gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display --cluster-local --scale-min 1\n# create event source\nkubectl apply -f deployments/producer-display-eventsource.yaml\n```\n\n### event producer with sinkbinding\n\n```bash\n# create event display\nkn service create event-display --image gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display --cluster-local --scale-min 1\n# create the sink binding\nkubectl apply -f deployments/producer-display-sinkbinding.yaml\n# create producer service\nkubectl create deployment event-producer --image=docker.io/alitari/ce-go-template-periodic-producer\n```\n\n### event mapper in sequence\n\n```bash\n# create event display\nkn service create event-display --image gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display --cluster-local --scale-min 1\n# create event mapper in reply mode\nkn service create event-mapper --image=docker.io/alitari/ce-go-template-mapper --cluster-local --scale-min 1\n# create sequence\nkubectl apply -f deployments/sequence.yaml\n# create pingsource\nkubectl apply -f deployments/pingsource-sequence.yaml\n```\n\n### event mapper as subject\n\n```bash\n# create event display\nkn service create event-display --image gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display --cluster-local --scale-min 1\n# create the sink binding\nkubectl apply -f deployments/mapper-display-sinkbinding.yaml\n# create event mapper in send mode\nkn service create event-mapper --image=docker.io/alitari/ce-go-template-mapper --scale-min 1\n# make a request\nMAPPER_URL=$(kubectl get ksvc event-mapper -o=json | jq -r .status.url)\nhttp POST $MAPPER_URL \"content-type: application/json\" \"ce-specversion: 1.0\" \"ce-source: http-command\" \"ce-type: http.demo\" \"ce-id: 123-abc\" name=Hase\n```\n\n## development\n\nSee [development](./docs/development.md)\n\n\n[CloudEvent]: https://github.com/cloudevents/spec\n[knative]: https://knative.dev/\n[CloudEvents spec]: https://github.com/cloudevents/spec/blob/v1.0/spec.md\n[CloudEvent Data]: https://github.com/cloudevents/spec/blob/v1.0/spec.md#event-data\n[CloudEvent context attributes]: https://github.com/cloudevents/spec/blob/v1.0/spec.md#context-attributes\n[go template]: https://golang.org/pkg/text/template/\n[ContainerSource]: https://knative.dev/docs/eventing/sources/containersource/\n[Sinkbinding]: https://knative.dev/docs/eventing/sources/sinkbinding/\n[Sequence]: https://knative.dev/docs/eventing/flows/sequence/\n[Parallel]: https://knative.dev/docs/eventing/flows/parallel/\n[httpie]: https://httpie.org/\n[Flows]: https://knative.dev/docs/eventing/flows/\n[event sink]: https://redhat-developer-demos.github.io/knative-tutorial/knative-tutorial-eventing/eventing-src-to-sink.html#eventing-sink\n[JSON representation of CloudEvent]: https://github.com/cloudevents/spec/blob/v1.0/json-format.md\n[sprig functions]: http://masterminds.github.io/sprig/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falitari%2Fce-go-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falitari%2Fce-go-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falitari%2Fce-go-template/lists"}