{"id":22369896,"url":"https://github.com/firmanmm/greb","last_synced_at":"2025-10-25T21:03:54.905Z","repository":{"id":57631650,"uuid":"408137915","full_name":"firmanmm/greb","owner":"firmanmm","description":"Golang HTTP Request Binding","archived":false,"fork":false,"pushed_at":"2024-01-24T15:20:08.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T19:40:13.324Z","etag":null,"topics":["golang","http"],"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/firmanmm.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":"2021-09-19T13:42:35.000Z","updated_at":"2024-01-24T15:04:24.000Z","dependencies_parsed_at":"2024-06-20T15:28:54.896Z","dependency_job_id":"3217ae93-a217-401a-ab2b-06c831b902f2","html_url":"https://github.com/firmanmm/greb","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/firmanmm%2Fgreb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanmm%2Fgreb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanmm%2Fgreb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanmm%2Fgreb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firmanmm","download_url":"https://codeload.github.com/firmanmm/greb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245690254,"owners_count":20656557,"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":["golang","http"],"created_at":"2024-12-04T19:29:39.784Z","updated_at":"2025-10-25T21:03:54.841Z","avatar_url":"https://github.com/firmanmm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang REquest Binder\n\nAn automated golang HTTP Request to struct binding. Why it exist? I don't know, i just think it will be better if we automate request binding and validation process doesn't it? \n\n## How to use\nYou need to create a new file with `.greb` extension. The `greb` extension is optional, but maybe we should stick with it shall we? \nTo install the package please use `go get github.com/firmanmm/greb/cmd/greb`.\nUse `greb -h` to show the help. To generate the golang file use `greb --in=example/simple/simple.greb --out=example/simple/simple.greb.go`.\nHere is a simple greb file definition. You should not mix `form` and `json` since it is all stored in the body.\n```\npackage simple\n\nrequest Simple {\n    ID              query:int           validate:\"required\"\n    GroupID         param:int           alias:\"group_id\"\n    Name            form:string         validate:\"required\"\n    Weight          json:float          alias:\"weight\"\n    IsAlive         form:bool\n    Authorization   header:string       validate:\"required\" alias:\"x-authorization\"\n    SessionID       cookie:string\n}\n```\n\n## Supported Binding\n\n### Binding Type\nBinding type is the source data to get the value.\n|Type|Description|\n| ------------- |:-------------|\n|query|Taken from query param|\n|form|Taken from body|\n|json|Taken from body|\n|header|Taken from header|\n|cookie|Taken from cookie|\n\n### Binding Data Type\nBinding data type is the data type to bind to.\n|Type|Description|\n| ------------- |:-------------|\n|int|Integer value|\n|float|Decimal value|\n|string|Literally string|\n|bool|`true` or `false`|\n|bytes|Uses multipart when in form, and base64 in other scenario|\n\n### Binding Tag\nBinding Tag is to extend greb's functionality. Tags can be combined for fun.\n|Tag|Description|\n| ------------- |:-------------|\n|validate|Perform data validation based on golang validator library|\n|alias|Override key used to get data|\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirmanmm%2Fgreb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirmanmm%2Fgreb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirmanmm%2Fgreb/lists"}