This repository is a Go library for producing Amazon Kinesis records (module github.com/kinesis-producer-go/kinesis-producer).
- Core implementation files live at the repository root:
producer.go,aggregator.go,config.go,randkey.go. - Protocol buffer schema and generated code:
messages.protoandmessages.pb.go. - Tests are colocated with source as
*_test.go(for example,producer_test.go,config_test.go,example_test.go). - Supporting docs are in root markdown files such as
README.mdandaggregation-format.md. - CI configuration is in
.github/workflows/ci.yml.
go mod download: fetch dependencies.go test -v ./...: run the full test suite (same baseline as CI).go test -race -v ./...: run tests with the race detector (also enforced in CI).make run-example: run the example test flow (TestExample).go test -v -run TestExample: run only the example test directly.
If you update messages.proto, regenerate protobuf code with:
protoc --go_out=. --go_opt=paths=source_relative messages.proto
- Follow standard Go style and keep code
gofmt-formatted (gofmt -w .before submitting). - Use tabs/formatting produced by
gofmt; avoid manual alignment. - Keep package-level API names clear and idiomatic (
New,Config,Put,Start,Stop). - File names should be lowercase with underscores only when needed (for example,
message_test.go).
- Use Go’s
testingpackage;testifyis available for assertions. - Place tests in
*_test.gofiles next to the code they validate. - Prefer table-driven tests for config validation and edge cases.
- Cover failure paths (AWS/Kinesis errors, buffering limits, shutdown behavior), not only happy paths.
- Use concise, imperative commit subjects with prefixes seen in history:
fix:,test:,deps:,docs:,refactor:,ci:. - All commits must be signed and signed-off: use
git commit -S -s -m "fix: ..."(required). - Keep commits focused; separate dependency bumps from behavior changes.
- PRs should include: purpose, behavior impact, test evidence (
go test -v ./...output), and linked issue(s) when applicable. - Update
README.mdor protocol docs when public behavior or message format changes.