{"id":19793578,"url":"https://github.com/darky/glerd-valid","last_synced_at":"2026-02-12T23:31:32.241Z","repository":{"id":249669247,"uuid":"832257018","full_name":"darky/glerd-valid","owner":"darky","description":"Gleam Record validators using Glerd metadata","archived":false,"fork":false,"pushed_at":"2024-09-19T16:29:40.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-13T09:29:22.402Z","etag":null,"topics":["gleam","glerd","validation","validator"],"latest_commit_sha":null,"homepage":"","language":"Gleam","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-22T16:31:15.000Z","updated_at":"2024-10-12T19:23:08.000Z","dependencies_parsed_at":"2024-07-22T16:44:49.464Z","dependency_job_id":"0e15087d-eecc-4c2a-91da-ebbac324e763","html_url":"https://github.com/darky/glerd-valid","commit_stats":null,"previous_names":["darky/glerd-valid"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/darky/glerd-valid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fglerd-valid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fglerd-valid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fglerd-valid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fglerd-valid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darky","download_url":"https://codeload.github.com/darky/glerd-valid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fglerd-valid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29386217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T22:07:52.078Z","status":"ssl_error","status_checked_at":"2026-02-12T22:07:49.026Z","response_time":55,"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":["gleam","glerd","validation","validator"],"created_at":"2024-11-12T07:10:26.985Z","updated_at":"2026-02-12T23:31:32.226Z","avatar_url":"https://github.com/darky.png","language":"Gleam","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glerd_valid\n\n[![Package Version](https://img.shields.io/hexpm/v/glerd_valid)](https://hex.pm/packages/glerd_valid)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/glerd_valid/)\n![Erlang-compatible](https://img.shields.io/badge/target-erlang-a2003e)\n![JavaScript-compatible](https://img.shields.io/badge/target-javascript-f1e05a)\n\nGleam Record validators using Glerd metadata\n\n```sh\ngleam add --dev glerd glerd_valid\n```\n\n#### 1. Describe your records with validation metadata\n\nExample:\n\n```gleam\npub type Cat {\n  /// valid:name:length:'gte=3, lt=50'\n  /// valid:lives_count:self:'min=1, max=9'\n  Cat(name: String, lives_count: Int)\n}\n```\n\n#### 2. Generate Records info\n\nUse [Glerd](https://github.com/darky/glerd)\n\n#### 3. Make module for validators generation\n\n###### my_module.gleam\n\n```gleam\nimport glerd_valid\nimport glerd_gen\n\npub fn main() {\n  glerd_gen.record_info\n  |\u003e glerd_valid.generate(\"src\", _)\n}\n```\n\n#### 4. Gen validators\n\n```sh\ngleam run -m my_module\n```\n\nFurther documentation can be found at \u003chttps://hexdocs.pm/glerd_valid\u003e.\n\n## Supported metadata\n\n#### Operators\n\n| operator | description                        |\n|----------|------------------------------------|\n| gte, min | should be greater than or equal to |\n| gt       |  should be greater than            |\n| lte, max |  should be less than or equal to   |\n| lt       |  should be less than               |\n| eq       |  should be equal to                |\n| ne       |  should not be equal to            |\n\n#### Levels\n\n| level  | description                  |\n|--------|------------------------------|\n| self   | check on Record field itself |\n| length | check on Record field length |\n\n#### Compatibility\n\n| operator | level  | type   |\n|----------|--------|--------|\n| gte, min | self   | Int    |\n| gte, min | self   | Float  |\n| gte, min | length | String |\n| gte, min | length | List   |\n|                            |\n| gt       | self   | Int    |\n| gt       | self   | Float  |\n| gt       | length | String |\n| gt       | length | List   |\n|                            |\n| lte, max | self   | Int    |\n| lte, max | self   | Float  |\n| lte, max | length | String |\n| lte, max | length | List   |\n|                            |\n| lt       | self   | Int    |\n| lt       | self   | Float  |\n| lt       | length | String |\n| lt       | length | List   |\n|                            |\n| eq       | self   | Int    |\n| eq       | self   | Float  |\n| eq       | self   | String |\n| eq       | self   | List   |\n| eq       | self   | Bool   |\n| eq       | length | String |\n| eq       | length | List   |\n|                            |\n| ne       | self   | Int    |\n| ne       | self   | Float  |\n| ne       | self   | String |\n| ne       | self   | List   |\n| ne       | self   | Bool   |\n| ne       | length | String |\n| ne       | length | List   |\n\n## Development\n\n```sh\ngleam test # and then commit generated file\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky%2Fglerd-valid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarky%2Fglerd-valid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky%2Fglerd-valid/lists"}