{"id":26667162,"url":"https://github.com/joeycumines/go-dotnotation","last_synced_at":"2025-07-22T17:33:59.136Z","repository":{"id":57490770,"uuid":"119510946","full_name":"joeycumines/go-dotnotation","owner":"joeycumines","description":"A simple dot notation accessor, to get and set values from data structures. ","archived":false,"fork":false,"pushed_at":"2018-01-31T12:02:16.000Z","size":17,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T23:51:31.207Z","etag":null,"topics":["dot-notation","golang-library","golang-package"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joeycumines.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}},"created_at":"2018-01-30T09:09:55.000Z","updated_at":"2024-09-02T11:22:46.000Z","dependencies_parsed_at":"2022-08-29T20:31:22.189Z","dependency_job_id":null,"html_url":"https://github.com/joeycumines/go-dotnotation","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/joeycumines/go-dotnotation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeycumines%2Fgo-dotnotation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeycumines%2Fgo-dotnotation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeycumines%2Fgo-dotnotation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeycumines%2Fgo-dotnotation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeycumines","download_url":"https://codeload.github.com/joeycumines/go-dotnotation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeycumines%2Fgo-dotnotation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266539558,"owners_count":23945045,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["dot-notation","golang-library","golang-package"],"created_at":"2025-03-25T19:36:26.295Z","updated_at":"2025-07-22T17:33:59.100Z","avatar_url":"https://github.com/joeycumines.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-dotnotation\n\nA simple dot notation accessor, to get and set values from data structures.\nThe intended use case is to simplify retrieving information from unstructured or\ndata in unknown formats, decoded from JSON, but it can be adapted for other\npurposes by providing custom handlers.\n\nThe package can be imported as `github.com/joeycumines/go-dotnotation/dotnotation`.\n\n```go\n\n// Accessor provides two methods, Get and Set, that can be configured to handle custom data structures via the\n// exported properties, Parser, Getter, and Setter.\ntype Accessor struct {\n\t// Getter returns the property value of a given target, or an error.\n\tGetter func(target interface{}, property string) (interface{}, error)\n\t// Setter sets the property value of a given target, to a given value, or returns an error.\n\tSetter func(target interface{}, property string, value interface{}) error\n\t// Parser converts a given key into a list of properties to access in order to get or set.\n\tParser func(key string) []string\n}\n\n// DefaultAccessor, used for the exported Set and Get functions.\nvar DefaultAccessor Accessor\n\n// Set sets a value using dot notation, by default it supports generic []interface{} and map[string]interface{} types.\n// It's behaviour can be configured by modifying the DefaultAccessor variable.\nfunc Set(target interface{}, key string, value interface{}) error {\n\treturn DefaultAccessor.Set(target, key, value)\n}\n\n// Get sets a value using dot notation, by default it supports generic []interface{} and map[string]interface{} types.\n// It's behaviour can be configured by modifying the DefaultAccessor variable.\nfunc Get(target interface{}, key string) (interface{}, error) {\n\treturn DefaultAccessor.Get(target, key)\n}\n```\n\n## Notes\n\n- `DefaultParser` just splits on `.`\n- `DefaultGetter` and `DefaultSetter` support `[]interface{}`,\n    `map[string]interface{}`, as well as those two types with one level of\n    pointer indirection (`*[]interface{}` and `*map[string]interface{}`)\n- Setting the next index (like `len(slice)`) of a `*[]interface{}` type\n    will append to the slice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeycumines%2Fgo-dotnotation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeycumines%2Fgo-dotnotation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeycumines%2Fgo-dotnotation/lists"}