{"id":20535051,"url":"https://github.com/jhuntdev/blest-go","last_synced_at":"2026-02-10T02:05:53.076Z","repository":{"id":177378631,"uuid":"660293421","full_name":"jhuntdev/blest-go","owner":"jhuntdev","description":"The Go reference implementation of BLEST (Batch-able, Lightweight, Encrypted State Transfer), an improved communication protocol for web APIs which leverages JSON, supports request batching by default, and provides a modern alternative to REST.","archived":false,"fork":false,"pushed_at":"2024-12-29T17:51:08.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T22:08:27.188Z","etag":null,"topics":[],"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/jhuntdev.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":"2023-06-29T17:10:38.000Z","updated_at":"2024-12-29T17:51:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"c351fcfc-6341-4b6c-963f-603baf4a1747","html_url":"https://github.com/jhuntdev/blest-go","commit_stats":null,"previous_names":["jhuntdev/blest-go"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/jhuntdev/blest-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhuntdev","download_url":"https://codeload.github.com/jhuntdev/blest-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29288803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T21:57:15.303Z","status":"online","status_checked_at":"2026-02-10T02:00:07.935Z","response_time":65,"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":[],"created_at":"2024-11-16T00:29:08.220Z","updated_at":"2026-02-10T02:05:53.063Z","avatar_url":"https://github.com/jhuntdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BLEST Go\n\nThe Go reference implementation of BLEST (Batch-able, Lightweight, Encrypted State Transfer), an improved communication protocol for web APIs which leverages JSON, supports request batching by default, and provides a modern alternative to REST. It includes an example for Gin.\n\nTo learn more about BLEST, please visit the website: https://blest.jhunt.dev\n\nFor a front-end implementation in React, please visit https://github.com/jhuntdev/blest-react\n\n## Features\n\n- Built on JSON - Reduce parsing time and overhead\n- Request Batching - Save bandwidth and reduce load times\n- Compact Payloads - Save even more bandwidth\n- Single Endpoint - Reduce complexity and facilitate introspection\n- Fully Encrypted - Improve data privacy\n\n## Installation\n\nInstall BLEST Go from Go Packages.\n\n```bash\ngo get github.com/jhuntdev/blest-go\n```\n\n## Usage\n\n### Router\n\n```go\npackage main\n\nimport {\n\t\"github.com/jhuntdev/blest-go\"\n\t\"github.com/gin-gonic/gin\"\n}\n\n// Create some middleware (optional)\nfunc userMiddleware(body interface{}, context *map[string]interface{}) {\n\t(*context)[\"user\"] = map[string]interface{}{\n\t\t// user info for example\n\t}\n}\n\n// Create a route controller\nfunc greetController(body interface{}, context *map[string]interface{}) (interface{}, error) {\n\tname, ok := body[\"name\"].(string)\n\tif !ok {\n\t\treturn nil, errors.New(\"name not found or has an invalid type\")\n\t}\n\tgreeting := fmt.Sprintf(\"Hi, %v!\", name)\n\treturn map[string]interface{}{\n\t\t\"greeting\": greeting,\n\t}, nil\n}\n\n// Create your router\nrouter := blest.Router()\nrouter.Use(userMiddleware)\nrouter.Route(\"greet\", greetController)\n\nfunc main() {\n\tr := gin.Default()\n\tr.POST(\"/\", func(c *gin.Context) {\n\t\tvar req gin.Request\n\t\tif err := c.ShouldBindJSON(\u0026req); err != nil {\n\t\t\tc.JSON(400, gin.H{\n\t\t\t\t\"error\": \"Invalid JSON payload\",\n\t\t\t})\n\t\t\treturn\n\t\t}\n\t\t// Use the router\n\t\tresponse, e := router.Handle(req.Data, nil)\n\t\tif e !== nil {\n\t\t\tc.JSON(500, e)\n\t\t} else {\n\t\t\tc.JSON(200, response)\n\t\t}\n\t})\n\tr.Run() // listen and serve on 0.0.0.0:8080\n}\n```\n\n### HttpClient\n\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/jhuntdev/blest-go\"\n)\n\nfunc main() {\n\t// Set headers (optional)\n\thttpHeaders := map[string]string{\n\t\t\"Authorization\": \"Bearer token\",\n\t}\n\n\t// Create a client\n\tclient := blest.NewHttpClient(\"http://localhost:8080\", map[string]interface{}{\"httpHeaders\": httpHeaders})\n\t\n\t// Send a request\n\tresult, err := client.Request(\"greet\", map[string]interface{}{ \"name\": \"Steve\" })\n\tif err != nil {\n\t\t// Do something in case of error\n\t} else {\n\t\t// Do something with the result\n\t}\n}\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhuntdev%2Fblest-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhuntdev%2Fblest-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhuntdev%2Fblest-go/lists"}