{"id":20913083,"url":"https://github.com/tbe/go-concourse-resource","last_synced_at":"2025-08-19T14:15:30.509Z","repository":{"id":151439144,"uuid":"616705872","full_name":"tbe/go-concourse-resource","owner":"tbe","description":"a Go module to simplify the development of concourse resources","archived":false,"fork":false,"pushed_at":"2023-03-21T10:54:50.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T22:41:43.084Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tbe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-20T23:10:03.000Z","updated_at":"2023-03-20T23:13:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"b29171e0-9e21-4c86-b849-fdcfa3cc3857","html_url":"https://github.com/tbe/go-concourse-resource","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tbe/go-concourse-resource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbe%2Fgo-concourse-resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbe%2Fgo-concourse-resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbe%2Fgo-concourse-resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbe%2Fgo-concourse-resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tbe","download_url":"https://codeload.github.com/tbe/go-concourse-resource/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbe%2Fgo-concourse-resource/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271166354,"owners_count":24710465,"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-19T02:00:09.176Z","response_time":63,"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":[],"created_at":"2024-11-18T14:34:46.650Z","updated_at":"2025-08-19T14:15:30.460Z","avatar_url":"https://github.com/tbe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# concourse-resource\n\n[![Go Report Card](https://goreportcard.com/badge/pkg.loki.codes/concourse-resource)](https://goreportcard.com/report/pkg.loki.codes/concourse-resource)\n[![Go Reference](https://pkg.go.dev/badge/pkg.loki.codes/concourse-resource.svg)](https://pkg.go.dev/pkg.loki.codes/concourse-resource)\n\n***a Go module to simplify the development of concourse resources***\n\n## Features\n\n### minimal dependencies\n\nOnly `github.com/stretchr/testify` and  `github.com/go-playground/validator/v10` are directly required by this module.\n\n### config validation\n\nTo validate your input, simply add the correct [`validator` tags](https://pkg.go.dev/github.com/go-playground/validator/v10) \n\n### flexible\n\nUse whatever library you want, do what ever you want. This module takes only care about the communication with concourse.\nNo assumptions beyond that are made.\n\n\n### testable\n\nTest your resources with `go test`. A full set of testing helpers and a `testify` suite are provided.\n\n## Usage\n\nTo develop a new resource, you must provide a type, that fulfills at least one of the following interfaces:\n\n- `types.CheckResource`\n- `types.InResource`\n- `types.OutResource`\n\nIf your resource takes parameters for `in` or `out`, the type must implement the `types.ParametrizedResource` interface.\n\nIn addition, a factory function must be provided.\n\nWhile all arguments to `check`, `in` and `out` are provided by the resource at runtime, the configuration (`source`)\nmust be provided statically.\n\nAll communication with *concourse* is done by the `Handler`. For an example of a resource, have a look at the [`test/dummy`](test/dummy)\nimplementation.\n\nInside your main, put all the stuff together and call the `Run` method.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\tresource \"pkg.loki.codes/concourse-resource\"\n\n\t\"your/resource/implementation\"\n)\n\nfunc main() {\n\tif err := resource.New[implementation.Config](implementation.New).Run(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\n```\n\n### Environment variables (metadata)\n\nThe [Concourse metadata](https://concourse-ci.org/implementing-resource-types.html#resource-metadata) can be accessed with the help\nof some wrappers. \n\nSee [metadata](metadata)\n\n## Container build\n\nTo build your container image, you may just symlink the binary to the correct locations. For example:\n\n```Dockerfile\nFROM golang:alpine AS builder\n\nRUN apk update \u0026\u0026 apk add --no-cache git ca-certificates \u0026\u0026 update-ca-certificates\n\nADD . /app/\nWORKDIR /app\nRUN CGO_ENABLED=0 go build -ldflags=\"-w -s\" -o resource .\nRUN mkdir -p /target/opt/resource/\nRUN cp resource /target/opt/resource/\nRUN ln -s resource /target/opt/resource/in\nRUN ln -s resource /target/opt/resource/out\nRUN ln -s resource /target/opt/resource/check\n\n\nFROM scratch\nCOPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/\nCOPY --from=builder /target/opt /opt\n```\n\n## See also\n\n- [Concourse Documentation](https://concourse-ci.org/implementing-resource-types.html****)\n\n## Testing\n\nThere is an extensive test framework. See [test](test)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbe%2Fgo-concourse-resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbe%2Fgo-concourse-resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbe%2Fgo-concourse-resource/lists"}