{"id":47701781,"url":"https://github.com/orislabsdev/gocore","last_synced_at":"2026-04-13T01:20:25.482Z","repository":{"id":347617906,"uuid":"1185461006","full_name":"orislabsdev/gocore","owner":"orislabsdev","description":"Engineering-first HTTP backend library for Go focused on performance, security, and production-ready architecture.","archived":false,"fork":false,"pushed_at":"2026-04-12T23:01:06.000Z","size":121,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-13T00:36:10.925Z","etag":null,"topics":["backend","go","golang","http","jwt","middleware","performance","production-ready","rate-limiting","rest-api","security","tls","web-framework","web-server"],"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/orislabsdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2026-03-18T15:54:52.000Z","updated_at":"2026-04-12T22:57:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/orislabsdev/gocore","commit_stats":null,"previous_names":["orislabsdev/gocore"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/orislabsdev/gocore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orislabsdev%2Fgocore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orislabsdev%2Fgocore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orislabsdev%2Fgocore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orislabsdev%2Fgocore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orislabsdev","download_url":"https://codeload.github.com/orislabsdev/gocore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orislabsdev%2Fgocore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31736124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T22:19:12.206Z","status":"ssl_error","status_checked_at":"2026-04-12T22:18:33.088Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["backend","go","golang","http","jwt","middleware","performance","production-ready","rate-limiting","rest-api","security","tls","web-framework","web-server"],"created_at":"2026-04-02T17:23:43.059Z","updated_at":"2026-04-13T01:20:25.454Z","avatar_url":"https://github.com/orislabsdev.png","language":"Go","readme":"# gocore\n\n\u003e **Engineering-first HTTP backend library for Go.** \n\u003e Built for performance, security, and developer productivity at Oris Labs.\n\n[![Go Version](https://img.shields.io/badge/go-1.22+-00ADD8?logo=go)](https://go.dev)\n[![Go Report Card](https://goreportcard.com/badge/github.com/orislabsdev/gocore)](https://goreportcard.com/report/github.com/orislabsdev/gocore)\n[![Coverage Status](https://img.shields.io/codecov/c/github/orislabsdev/gocore)](https://codecov.io/gh/orislabsdev/gocore)\n[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n[![Security Policy](https://img.shields.io/badge/security-policy-blue)](SECURITY.md)\n\n---\n\n## Why gocore?\n\nIn a world of \"magic\" frameworks, **gocore** takes a different approach. It provides a structured, production-ready foundation for Go services without hiding the standard library.\n\n### Comparison: net/http vs. Popular Frameworks vs. gocore\n\n| Feature | `net/http` | Gin / Echo | **gocore** |\n| :--- | :---: | :---: | :---: |\n| **Complexity** | Low | High (Magic) | **Medium (Transparent)** |\n| **Router** | Basic (pre-1.22) | High-speed Radix | **High-speed Trie** |\n| **Security** | Manual | Middleware-based | **Hardened Defaults** |\n| **Boilerplate** | High | Low | **Low (Modular)** |\n| **Standard Lib** | 100% | Replaces Context | **100% Compatible** |\n\n**gocore** is designed for engineering teams who need to move fast but refuse to compromise on visibility, reliability, or security.\n\n---\n\n## Engineering Evidence\n\n### Security Design \u0026 Threat Model\n\n`gocore` is engineered with a multi-layered security approach:\n\n1.  **Attack Surface Reduction**: Only 4 external dependencies (`jwt`, `x/time`, `prometheus`, `redis`). No bloated dependency trees.\n2.  **Hardened Defaults**:\n    - **HSTS**: Enforces HTTPS for 1 year by default.\n    - **CSP**: Restrictive `default-src 'self'` policy.\n    - **Slowloris Protection**: `ReadHeaderTimeout` set to 10s by default.\n    - **mTLS**: Native support for client certificate verification.\n3.  **Threat Model Mitigation**:\n    - **Injection**: Path parameters are strictly parsed via Trie nodes.\n    - **Brute Force**: Pluggable memory or Redis-backed token-bucket rate limiter per IP/Client.\n    - **Token Hijacking**: JWT multi-source extraction (Header/Cookie) with TTL enforcement.\n    - **Metrics Cardinality**: Prometheus metrics are protected against memory-exhaustion by tracking the underlying router pattern (e.g., `/users/:id`) instead of raw request URLs.\n\n### Architecture \u0026 Tradeoffs\n\nThe `gocore` architecture is strictly acyclic (`config -\u003e auth -\u003e middleware -\u003e router -\u003e server -\u003e core`). \n\n**Tradeoff: Trie vs. Radix Router**\nWe chose a **Trie-based router** over a Radix tree. While Radix trees can be slightly faster for massive routing tables, the Trie implementation provides **O(depth)** matching and significantly clearer code for debugging complex REST patterns with wildcards and path parameters.\n\n### Benchmarks (O(depth) Performance)\n\nPreliminary routing benchmarks indicate sub-microsecond matching latency for deep trees:\n\n```text\nBenchmarkRouter/Static-4         232.3 ns/op          64 B/op          2 allocs/op\nBenchmarkRouter/Param-4          440.7 ns/op         400 B/op          3 allocs/op\nBenchmarkRouter/Wildcard-4       621.9 ns/op         544 B/op          5 allocs/op\n```\n\n---\n\n## Production Ready\n\n### Simplified Setup\n\n```go\napp := gocore.New() // Starts with safe, hardened defaults\napp.UseDefaults()    // RequestID, Recovery, Logger, Security, CORS, RateLimit\n\napi := app.Group(\"/api/v1\")\napi.GET(\"/health\", builtin.HealthCheck()).Public()\n\nif err := app.Run(); err != nil {\n    app.Logger().Fatal(\"server failed\", \"error\", err)\n}\n```\n\n### Strategic Roadmap (v0.x)\n\n- [x] **v0.2.0**: Prometheus metrics exporter integration.\n- [x] **v0.3.0**: Distributed rate limiting (Redis provider).\n- [x] **v0.4.0**: Automatic OpenAPI (Swagger) documentation generation.\n- [x] **v0.5.0**: Websocket support.\n- [x] **v0.5.1**: Updated to Go `1.25.0` and updated dependencies.\n- [x] **v0.5.2**: WebSocket configuration and expansion.\n- [ ] **v0.6.0**: TBD.\n- [ ] **v1.0.0**: Stable API release.\n\n---\n\n## Resources\n\n- [Architecture Guide](RESOURCES/ARCHITECTURE.md)\n- [Example Application](example/main.go)\n- [Contributing](CONTRIBUTING.md)\n- [Changelog](CHANGELOG.md)\n\n---\n\n\u0026copy; 2026 Oris Labs. Built by engineers, for engineers.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forislabsdev%2Fgocore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forislabsdev%2Fgocore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forislabsdev%2Fgocore/lists"}