{"id":30249178,"url":"https://github.com/flowerinthenight/clockbound-client-go","last_synced_at":"2025-08-15T08:38:52.238Z","repository":{"id":273673560,"uuid":"920461952","full_name":"flowerinthenight/clockbound-client-go","owner":"flowerinthenight","description":"Go(lang) client for aws/clock-bound.","archived":false,"fork":false,"pushed_at":"2025-01-22T09:49:49.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T10:22:39.179Z","etag":null,"topics":["aws-clockbound","client","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}},"created_at":"2025-01-22T07:34:54.000Z","updated_at":"2025-01-22T09:53:03.000Z","dependencies_parsed_at":"2025-01-22T10:22:42.101Z","dependency_job_id":"d551d157-ba38-407d-8a98-1afd2d57fe6a","html_url":"https://github.com/flowerinthenight/clockbound-client-go","commit_stats":null,"previous_names":["flowerinthenight/clockbound-client-go"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/flowerinthenight/clockbound-client-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fclockbound-client-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fclockbound-client-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fclockbound-client-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fclockbound-client-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flowerinthenight","download_url":"https://codeload.github.com/flowerinthenight/clockbound-client-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fclockbound-client-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270546174,"owners_count":24604455,"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-15T02:00:12.559Z","response_time":110,"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":["aws-clockbound","client","golang","shared-memory","shm","true-time"],"created_at":"2025-08-15T08:38:47.561Z","updated_at":"2025-08-15T08:38:52.217Z","avatar_url":"https://github.com/flowerinthenight.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"**NOTE: Unusable at the moment. Still under investigation but it looks like the As-Of-Timestamp value read from SHM indicates elapsed time from boot, not from Jan 1 1970 UTC (Unix epoch). Could be the way SHM is being read.**\n\nIn the meantime, if you can use CGO, have a look at [clockbound-ffi-go](https://github.com/flowerinthenight/clockbound-ffi-go).\n\n---\n\n[![main](https://github.com/flowerinthenight/clockbound-client-go/actions/workflows/main.yml/badge.svg)](https://github.com/flowerinthenight/clockbound-client-go/actions/workflows/main.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/flowerinthenight/clockbound-client-go.svg)](https://pkg.go.dev/github.com/flowerinthenight/clockbound-client-go)\n\n## clockbound-client-go\n\nA Go client for [AWS ClockBound](https://github.com/aws/clock-bound) using the newer [ClockBound Shared Memory Protocol Version 1](https://github.com/aws/clock-bound/blob/main/docs/PROTOCOL.md#clockbound-shared-memory-protocol-version-1) (ClockBound version 1.0.0 and later). Pre-1.0.0 uses the [ClockBound Unix Datagram Socket Protocol Version 1](https://github.com/aws/clock-bound/blob/main/docs/PROTOCOL.md#clockbound-unix-datagram-socket-protocol-version-1). Only tested on Linux on little endian CPU architecture.\n\nThe [ClockBound daemon](https://github.com/aws/clock-bound/tree/main/clock-bound-d) must be running in order to use this library.\n\nUsage looks something like this:\n\n```go\nimport (\n  ...\n  clockboundclient \"github.com/flowerinthenight/clockbound-client-go\"\n)\n\nfunc main() {\n  // error checks redacted\n  client, _ := clockboundclient.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 with the ClockBound daemon already setup.\n\n```sh\n# Create a launch template. ImageId here is Amazon Linux, default VPC.\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-0fb04413c9de69305\",\n    \"InstanceType\":\"t2.micro\"\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 clockbound-client-sample-v{latest-version}-x86_64-linux.tar.gz\n$ ./example\n2025/01/23 03:03:59 earliest: 1970-01-01T00:04:03.189017214Z\n2025/01/23 03:03:59 latest  : 1970-01-01T00:04:03.190960726Z\n2025/01/23 03:03:59 range: 1.943512ms\n2025/01/23 03:03:59 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-client-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflowerinthenight%2Fclockbound-client-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowerinthenight%2Fclockbound-client-go/lists"}