{"id":20506392,"url":"https://github.com/chaosunity/vaker","last_synced_at":"2026-03-09T11:03:39.410Z","repository":{"id":38391058,"uuid":"463922423","full_name":"ChAoSUnItY/vaker","owner":"ChAoSUnItY","description":"Light-weight data faker built in V to generate massive amounts of fake (but realistic) data for testing and development.","archived":false,"fork":false,"pushed_at":"2023-09-06T15:11:37.000Z","size":97,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T21:42:27.885Z","etag":null,"topics":["compile-time","datafaker","vlang"],"latest_commit_sha":null,"homepage":"","language":"V","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/ChAoSUnItY.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}},"created_at":"2022-02-26T17:36:50.000Z","updated_at":"2025-04-16T10:25:05.000Z","dependencies_parsed_at":"2024-02-01T20:08:01.386Z","dependency_job_id":"68c18a6c-0f07-41b5-89c5-74f39b149577","html_url":"https://github.com/ChAoSUnItY/vaker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ChAoSUnItY/vaker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChAoSUnItY%2Fvaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChAoSUnItY%2Fvaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChAoSUnItY%2Fvaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChAoSUnItY%2Fvaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChAoSUnItY","download_url":"https://codeload.github.com/ChAoSUnItY/vaker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChAoSUnItY%2Fvaker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30291847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: 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":["compile-time","datafaker","vlang"],"created_at":"2024-11-15T19:56:48.309Z","updated_at":"2026-03-09T11:03:39.392Z","avatar_url":"https://github.com/ChAoSUnItY.png","language":"V","readme":"# vaker\n\u003e Light-weight data faker built in V to generate massive amounts of fake (but realistic) data for testing and development.\n\n[![Vaker-doc - Document](https://img.shields.io/badge/_Vaker--doc-Document-2ea44f?logo=V)](https://chaosunity.github.io/Vaker-doc/)\n\n## Usage\n\n### Basic\n```v\nimport vaker\n\nfn main() {\n    a := []string{len:10}\n    vaker.fake_data(\u0026a)\n}\n```\n\n### Credit Card\n```v\nimport vaker\n\n// Don't add [required] so you don't have to assign all values at start\nstruct MemberInfo {\n\tmember_name        string ['vaker:name']\n\tcredit_card_type   string ['vaker:cc_type']\n\tcredit_card_number string ['vaker:cc_number']\n}\n\nfn main() {\n\ta := MemberInfo{}\n\tvaker.fake_data(\u0026a)\n}\n```\n\n### Geo-related data\n```v\nimport vaker\n\nstruct GeoData {\n\tlocation  Location\n\temail\t  string   ['vaker:email']\n\tuser_name string   ['vaker:user_name']\n}\n\nstruct Location {\n\tlongtitude string ['vaker:long']\n\tlatitude   string ['vaker:lat']\n}\n\nfn main() {\n\ta := GeoData{}\n\tvaker.fake_data(\u0026a)\n}\n```\n\n### Custom faking functions\n\u003e You can find the custom faking function example in [example_custom_attribute.v](/example_custom_attribute.v)\nTo add custom faking functions:\n\n1. Clone a DataFaker\n```v\nmut df := vaker.new_df()\n```\n\n2. register a unit (or domain)\n```v\ndf.register('your unit')\n```\n\n3. create a faking function, faking function must be `fn (vaker.PtrInfo)`, you'll need to provide a type parameter to specify which type your faking function at least support\n```v\ndf.register_fn\u003cTypeHere\u003e('your domain', 'your faking function's name', faking_function_ptr) ?\n```\n\n4. (Optional) to support more types to be accepted by your faking function, call `vaker.DataFaker#add_type\u003cT\u003e(string, string)`\n```v\n// add support for string type\ndf.add_type\u003cstring\u003e('your unit', 'your faking function\\'s name') ?\n```\n\n## Supported Data Types\n\nVaker supports:  \n`[]T`, `T[]! (Sized array)`, `map[K]V`, `string`, `rune`, `bool`, `i8`, `i16`,  \n`int`, `i64`, `byte`, `u16`, `u32`, `u64`, `f32`, `f64`, `struct`, `time.Time`\n\n**while:**\n***every type symbols: T, K, V, isn't interface***\n\nAdditionally, Vaker supports embedded structure, or nested struct data faking.\n\nVaker does not support faking:\n`interface`\n\nSee [Limitations](#limitations)\n\n## Supported Attributes\n\nSee [example.v](./example.v) for full attribute list and their effects.\n\n## Spec\n\nVaker uses compile time reflection to minimize runtime memory overhead as much as possible.\n\n### Bench\n\n```v\nimport vaker\n\nstruct St {\n\tBs\n\ta string ['vaker:str_len=10']\n}\n\nstruct Bs {\n\tFs\n\ta string ['vaker:skip']\n}\n\nstruct Fs {\n\ta map[int]string\n}\n\nfn main() {\n\ta := map[int]string{}\n\tst := St{}\n\tb := []int{len: 6}\n\tvaker.fake_data(\u0026a)\n\tvaker.fake_data(\u0026st)\n\tvaker.fake_data(\u0026b)\n}\n```\n\n```cmd\n\u003e v run ./main.v\n\n================\nCPU     136%\nuser    0.258\nsystem  0.038\ntotal   0.217\n```\n\n```cmd\n\u003e v -prod ./main.v\n\n================\nCPU     101%\nuser    4.062\nsystem  0.136\ntotal   4.121\n     \n\u003e ./main\n\n================\nCPU     82%\nuser    0.001\nsystem  0.000\ntotal   0.002\n```\n\n### Explaination\n\nVaker generates faking functions at compile time, so it spend more memory/time on compilation, but this doesn't effect actual runtime performance.\n\n## Limitations\n\n1. Vaker does not support faking interface, since interface in V cannot be implemented in runtime.\n\n## Contribution\n\nYou can open a PR or an issue.\n\n## Maintainers\n\nChAoS-UnItY\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaosunity%2Fvaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaosunity%2Fvaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaosunity%2Fvaker/lists"}