{"id":13515129,"url":"https://github.com/realbucksavage/stargate","last_synced_at":"2025-12-30T09:58:45.385Z","repository":{"id":42035680,"uuid":"250868310","full_name":"realbucksavage/stargate","owner":"realbucksavage","description":"A lightweight and extensible library to build gateway servers.","archived":false,"fork":false,"pushed_at":"2023-10-06T12:43:21.000Z","size":100,"stargazers_count":20,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-02-01T23:58:20.145Z","etag":null,"topics":["api-gateway","go","golang"],"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/realbucksavage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2020-03-28T18:41:13.000Z","updated_at":"2024-04-15T14:00:57.166Z","dependencies_parsed_at":"2023-01-24T06:00:37.100Z","dependency_job_id":"ad164839-034f-4903-9a85-07014a81e795","html_url":"https://github.com/realbucksavage/stargate","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realbucksavage%2Fstargate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realbucksavage%2Fstargate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realbucksavage%2Fstargate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realbucksavage%2Fstargate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/realbucksavage","download_url":"https://codeload.github.com/realbucksavage/stargate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246418658,"owners_count":20773934,"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":["api-gateway","go","golang"],"created_at":"2024-08-01T05:01:06.594Z","updated_at":"2025-12-30T09:58:45.335Z","avatar_url":"https://github.com/realbucksavage.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/realbucksavage/stargate.svg)](https://pkg.go.dev/github.com/realbucksavage/stargate)\n[![codecov](https://codecov.io/gh/realbucksavage/stargate/branch/main/graph/badge.svg?token=QCRZ7IT8Y3)](https://codecov.io/gh/realbucksavage/stargate)\n[Report Card](https://www.goreportcard.com/report/github.com/realbucksavage/stargate)\n\n# Stargate\n\nA minimal and extensible library to build gateway servers. Stargate aims to be simple while providing niche solutions\nlike several load balancer implementations, middleware, service discovery, etc.\n\nStargate supports:\n\n- WebSockets\n- Hot-reloading of routes\n- Middleware\n\n[stargatecontrb](https://github.com/realbucksavage/stargatecontrib) contains some middleware implementations that are\nnot in the scope of this library, but might be useful for some people.\n\n## Getting started\n\nCheck the [basic example](./_examples/basic/main.go) that implements a\n`stargate.ServiceLister` to create a static table of routes and uses round-robin approach to load balance the request.\n\nIn the same sprits, the [WebSockets example](./_examples/websockets/main.go) shows a simple WebSocket backend.\n\n### Customize logging\n\nStargate uses `stargate.Log` variable to write its logging output. This variable is an implementation\nof `stargate.Logger`. You may write your own implementation of this interface and write `stargate.Log = myOwnLogger{}`\nwhenever your program starts.\n\nCheck the [custom logger example](./_examples/logger_custom/main.go).\n\n### Using dynamic route tables.\n\nIf the `stargate.ServiceLister`'s implementation updates the route table, the `stargate.Router` instance can be told to\nupdate the routing by calling the `Reload()` method.\n\nCheck the [reloading routes example](./_examples/reloading_router/reload.go).\n\n#### Eureka service discovery\n\nCheck the [eureka package in stargatecontrib](https://github.com/realbucksavage/stargatecontrib/tree/main/lister/eureka).\n\n### Middleware\n\nStargate defines middleware as:\n\n```go\ntype MiddlewareFunc func (http.Handler) http.Handler\n```\n\nCheck the [middleware example](./_examples/middleware/main.go), that counts the number of requests served.\n\n## Open TODOs\n\n- Improve logging\n- Improve documentation\n- Write more tests\n- Customizable healthchecks\n\n#### `LoadBalancer` implementations\n\n- Priority round-robin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealbucksavage%2Fstargate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealbucksavage%2Fstargate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealbucksavage%2Fstargate/lists"}