{"id":30249190,"url":"https://github.com/flowerinthenight/clockbound-ffi-go","last_synced_at":"2026-05-13T22:32:34.831Z","repository":{"id":274617555,"uuid":"923499355","full_name":"flowerinthenight/clockbound-ffi-go","owner":"flowerinthenight","description":"Go client for aws/clock-bound using FFI and CGO.","archived":false,"fork":false,"pushed_at":"2025-11-26T04:50:32.000Z","size":5945,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-29T06:29:25.489Z","etag":null,"topics":["aws","cgo","client","clock-bound","ffi","golang","shared-memory","shm","true-time"],"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/flowerinthenight.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-28T11:04:47.000Z","updated_at":"2025-11-26T04:49:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"69b36d20-e32a-4b98-8224-17428326a6fc","html_url":"https://github.com/flowerinthenight/clockbound-ffi-go","commit_stats":null,"previous_names":["flowerinthenight/clockbound-ffi-go"],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/flowerinthenight/clockbound-ffi-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fclockbound-ffi-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fclockbound-ffi-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fclockbound-ffi-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fclockbound-ffi-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flowerinthenight","download_url":"https://codeload.github.com/flowerinthenight/clockbound-ffi-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fclockbound-ffi-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33002688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aws","cgo","client","clock-bound","ffi","golang","shared-memory","shm","true-time"],"created_at":"2025-08-15T08:38:54.021Z","updated_at":"2026-05-13T22:32:34.826Z","avatar_url":"https://github.com/flowerinthenight.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![main](https://github.com/flowerinthenight/clockbound-ffi-go/actions/workflows/main.yml/badge.svg)](https://github.com/flowerinthenight/clockbound-ffi-go/actions/workflows/main.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/flowerinthenight/clockbound-ffi-go.svg)](https://pkg.go.dev/github.com/flowerinthenight/clockbound-ffi-go)\n\n\u003e [!IMPORTANT]  \n\u003e This library is still using the `main-2.0` branch of the [ClockBound daemon](https://github.com/aws/clock-bound).\n\n## clockbound-ffi-go\n\nA Go client for [aws/clock-bound](https://github.com/aws/clock-bound) using the provided [FFI](https://github.com/aws/clock-bound/tree/main/clock-bound-ffi) (requires [CGO](https://pkg.go.dev/cmd/cgo)).\n\nThe [ClockBound daemon](https://github.com/aws/clock-bound) must be running in order to use this library, as well as the dependencies from the FFI.\n\n```sh\n# Rust environment is expected to be installed.\n$ git clone --single-branch -b main-2.0 https://github.com/aws/clock-bound\n$ cd clock-bound/clock-bound-ffi/\n$ cargo build --release\n$ cd ../\n$ [sudo] cp clock-bound-ffi/include/clockbound.h /usr/include/\n$ [sudo] cp target/release/libclockbound.a /usr/lib/\n$ [sudo] cp target/release/libclockbound.so /usr/lib/\n```\n\nUsage looks something like this (you need to have a C compiler for `CGO`):\n\n```go\nimport (\n  ...\n  \"github.com/flowerinthenight/clockbound-ffi-go\"\n)\n\nfunc main() {\n  // error checks redacted\n  client, _ := clockbound.New()\n  now, _ := client.Now()\n  ...\n  client.Close()\n}\n```\n\nCheck out the provided [example](./example/main.go) code for a more complete reference on how to use the client.\n\nA cloud-init [startup script](./startup-aws-asg.sh) is also provided for spinning up an [ASG](https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-groups.html) with the ClockBound daemon already setup.\n\n```sh\n# Create a launch template. ImageId here is Amazon Linux, default VPC.\n# You can remove the \"KeyName\" line if SSH access is not needed.\n# (Added newlines for readability. Might not run when copied as is.)\n$ aws ec2 create-launch-template \\\n  --launch-template-name cbclient-lt \\\n  --version-description version1 \\\n  --launch-template-data '\n  {\n    \"UserData\":\"'\"$(cat startup-aws-asg.sh | base64 -w 0)\"'\",\n    \"ImageId\":\"ami-0fe289b44779ce58a\",\n    \"InstanceType\":\"t3.medium\",\n    \"KeyName\":\"keyName\"\n  }'\n\n# Create the ASG; update {target-zone} with actual value:\n$ aws autoscaling create-auto-scaling-group \\\n  --auto-scaling-group-name cbclient-asg \\\n  --launch-template LaunchTemplateName=cbclient-lt,Version='1' \\\n  --min-size 1 \\\n  --max-size 1 \\\n  --availability-zones {target-zone}\n\n# You can now SSH to the instance. Note that it might take some time before\n# ClockBound is running due to the need to build it in Rust. You can wait\n# for the `clockbound` process, or tail the startup script output, like so:\n$ tail -f /var/log/cloud-init-output.log\n\n# Run the sample code:\n# Download the latest release sample from GitHub.\n$ tar xvzf cbffisample-{version}-x86_64-linux.tar.gz\n$ ./example\n2025/01/29 01:39:25 earliest: 2025-01-29T01:39:25.288385857Z\n2025/01/29 01:39:25 latest  : 2025-01-29T01:39:25.290784645Z\n2025/01/29 01:39:25 range: 2.398788ms\n2025/01/29 01:39:25 status: SYNCHRONIZED\n...\n```\n\n## License\n\nThis library is licensed under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowerinthenight%2Fclockbound-ffi-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflowerinthenight%2Fclockbound-ffi-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowerinthenight%2Fclockbound-ffi-go/lists"}