{"id":13786681,"url":"https://github.com/rekby/objwalker","last_synced_at":"2025-09-05T05:35:05.198Z","repository":{"id":43373517,"uuid":"456800929","full_name":"rekby/objwalker","owner":"rekby","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-04T18:45:53.000Z","size":66,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T07:22:34.471Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rekby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-08T05:50:42.000Z","updated_at":"2024-10-03T19:43:24.000Z","dependencies_parsed_at":"2022-09-02T18:32:03.541Z","dependency_job_id":null,"html_url":"https://github.com/rekby/objwalker","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekby%2Fobjwalker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekby%2Fobjwalker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekby%2Fobjwalker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekby%2Fobjwalker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rekby","download_url":"https://codeload.github.com/rekby/objwalker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246277360,"owners_count":20751549,"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":[],"created_at":"2024-08-03T19:01:28.172Z","updated_at":"2025-03-30T05:13:35.239Z","avatar_url":"https://github.com/rekby.png","language":"Go","readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/rekby/objwalker.svg)](https://pkg.go.dev/github.com/rekby/objwalker)\n[![Coverage Status](https://coveralls.io/repos/github/rekby/objwalker/badge.svg?branch=master)](https://coveralls.io/github/rekby/objwalker?branch=master)\n[![GoReportCard](https://goreportcard.com/badge/github.com/rekby/objwalker)](https://goreportcard.com/report/github.com/rekby/objwalker)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\nDeep walk by object with reflection. Walker.Walk(v interface{}) call callback function for v object, every field if it struct, every item for slice/array and every key and item for map object. It walk for object recursive and call callback for every object in tree.\n\nIt has loop protection - for not hang on cycled structured, protection can be disabled if need.\n\nWalkInfo - struct, send as argument to callback function include:\n\n* ```Value``` - reflection.Value object for read/manipulate with it.\n* ```DataPointer``` - direct pointer to underly data, for example - pointer to bytes under string, ot pointer to data under slice. It is danger to manipulate it, but can userful for example for compare objects.\n* ```Parent``` - parent of the value in travel tree\n* and some other hints about Value\n\n```golang\n    package main\n\n    import \"github.com/rekby/objwalker\"\n\n    func main() {\n\t\ttype S struct {\n\t\t\tVal1  int\n\t\t\tSlice []string\n\t\t}\n\n\t\tval := S{\n\t\t\tVal1:  2,\n\t\t\tSlice: []string{\"hello\", \"world\"},\n\t\t}\n\t\t_ = New(func(info *WalkInfo) error {\n\t\t\tfmt.Println(info.Value.Interface())\n\t\t\treturn nil\n\t\t}).Walk(val)\n\n\t\t// Output:\n\t\t// {2 [hello world]}\n\t\t// 2\n\t\t// [hello world]\n\t\t// hello\n\t\t// world\n\t}\n```\n","funding_links":[],"categories":["Utilities","Reflection","公用事业公司"],"sub_categories":["Utility/Miscellaneous","HTTP Clients","Fail injection","实用程序/Miscellaneous","HTTP客户端"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frekby%2Fobjwalker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frekby%2Fobjwalker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frekby%2Fobjwalker/lists"}