{"id":24812946,"url":"https://github.com/team-triage/triage-client-go","last_synced_at":"2026-04-27T12:04:59.266Z","repository":{"id":62867358,"uuid":"561863585","full_name":"Team-Triage/triage-client-go","owner":"Team-Triage","description":"A thin Go client library for interacting with a Triage deployment","archived":false,"fork":false,"pushed_at":"2023-08-22T15:25:13.000Z","size":61,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T14:55:05.689Z","etag":null,"topics":["client-library","go","grpc"],"latest_commit_sha":null,"homepage":"https://team-triage.github.io/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Team-Triage.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":"2022-11-04T16:59:48.000Z","updated_at":"2022-12-03T15:52:56.000Z","dependencies_parsed_at":"2024-06-20T01:35:07.869Z","dependency_job_id":"c304c74e-d6b9-4584-9768-93e9ed3f3b53","html_url":"https://github.com/Team-Triage/triage-client-go","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Team-Triage%2Ftriage-client-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Team-Triage%2Ftriage-client-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Team-Triage%2Ftriage-client-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Team-Triage%2Ftriage-client-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Team-Triage","download_url":"https://codeload.github.com/Team-Triage/triage-client-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245504094,"owners_count":20626297,"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","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":["client-library","go","grpc"],"created_at":"2025-01-30T14:55:22.384Z","updated_at":"2026-04-27T12:04:59.213Z","avatar_url":"https://github.com/Team-Triage.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# triage-client-go\r\n\r\nThin Go client for subscribing to the Triage service for Kafka.\r\n\r\n\u003ch2\u003eHow it works\u003c/h2\u003e\r\n\r\nThe `triage-client-go` library interacts with a Triage deployment by running a gRPC server that listens for a incoming messages (gRPC method calls). Users pass a message handler function to the library, which acts as middleware. Each message received is passed to the message handler, and `triage-client-go` uses the return of the message handler to determine the response sent back to Triage.\r\n\r\n\u003ch2\u003eHow to get it\u003c/h2\u003e\r\n\r\nTo get the latest version, use `go 1.19*` and fetch using the `go get` command. For example:\r\n\r\n    go get github.com/team-triage/triage-client-go\r\n\r\n\u003ch2\u003eHow to use it\u003c/h2\u003e\r\nThis client provides 3 utility functions used for interacting with Triage.\r\n\r\n\u003ch4\u003eOnMessage\u003c/h4\u003e\r\n\r\nThe `OnMessage(messageHandler func(string) int)` function accepts a `messageHandler` function. This function should accept a string (the value of the Kafka message) and return either integers `1` or `-1` , representing the successful or unsuccessful processing of a message.\r\n\r\n\r\nThe function passed to `OnMessage` acts as middleware - when the gRPC server receives a message from Triage, it will call the `messageHandler` passed to it to determine the response sent back to Triage.\r\n\r\n\r\nA `1` sends a positive acknowledgment to Triage, letting it know that it is safe to commit this message's offset back to Kafka.\r\n\r\n\r\nA `-1` sends a negative acknowledgment to Triage. Triage will store this message in a DynamoDB table for later processing, before committing it's offset back to Kafka.\r\n\r\n\r\n\r\n\u003ch4\u003eListen\u003c/h4\u003e\r\n\r\nThe `Listen(grpcPort  string)` function starts a gRPC server on the specified port. This port should be the same that is sent to Triage by `RequestConnection`. This should be called before `RequestConnection` (see below).\r\n\r\n\r\n\u003ch4\u003eRequestConnection\u003c/h4\u003e\r\n\r\nThe `RequestConnection(triageNetworkAddress string, grpcPort string, authToken string)` function makes an initial request to Triage, informing it that the consumer application is ready to begin accepting connections. It accepts 3 arguments:\r\n  - `triageNetworkAddress`: The network address provided during Triage deployment. This is typically an AWS internet-facing application load balancer address.\r\n  - `grpcPort`: The port used by the consumer application to listen for incoming messages.\r\n  - `authToken`: The authentication key provided during Triage deployment.\r\n\r\n\r\n\u003ch2\u003eExample Consumer Application\u003c/h2\u003e\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n  client \"github.com/team-triage/triage-client-go\"\r\n  \"sync\"\r\n)\r\n\r\nvar wg sync.WaitGroup\r\n\r\nfunc main() {\r\n  grpcPort := \"9000\"\r\n  triageNetworkAddress := \"Triag-Triage-123456.us-west-1.elb.amazonaws.com\"\r\n  authKey := \"ABADAUTHKEY\"\r\n\r\n  client.OnMessage(dummyMessageHandler)\r\n  \r\n  wg.Add(1)\r\n  client.Listen(grpcPort)\r\n  \r\n  res := client.RequestConnection(triageNetworkAddress, grpcPort, authKey)\r\n  \r\n  if res.StatusCode == http.StatusOK {\r\n\t\tfmt.Printf(\"Status Code: %v \\n ready to receive messages!\\n\", res.StatusCode)\r\n\t} else {\r\n\t\tfmt.Printf(\"Status Code: %v\\n There was a problem connecting to Triage :(\\n\", res.StatusCode)\r\n\t}\r\n  \r\n  wg.Wait()\r\n}\r\n\r\nfunc dummyMessageHandler(msg string) int {\r\n  if len(msg) \u003e 4 {\r\n    return 1\r\n  }\r\n  return -1\r\n}\r\n\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteam-triage%2Ftriage-client-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteam-triage%2Ftriage-client-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteam-triage%2Ftriage-client-go/lists"}