{"id":15649288,"url":"https://github.com/u2takey/go-annotation","last_synced_at":"2025-04-30T16:20:25.916Z","repository":{"id":57530177,"uuid":"265797297","full_name":"u2takey/go-annotation","owner":"u2takey","description":"Annotation libraries and tools for golang.","archived":false,"fork":false,"pushed_at":"2020-05-30T16:07:05.000Z","size":24,"stargazers_count":40,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T17:46:13.029Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/u2takey.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":"2020-05-21T08:38:47.000Z","updated_at":"2024-06-26T01:18:53.000Z","dependencies_parsed_at":"2022-09-26T18:11:32.424Z","dependency_job_id":null,"html_url":"https://github.com/u2takey/go-annotation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u2takey%2Fgo-annotation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u2takey%2Fgo-annotation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u2takey%2Fgo-annotation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u2takey%2Fgo-annotation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/u2takey","download_url":"https://codeload.github.com/u2takey/go-annotation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251739902,"owners_count":21635944,"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-10-03T12:29:09.231Z","updated_at":"2025-04-30T16:20:25.892Z","avatar_url":"https://github.com/u2takey.png","language":"Go","readme":"# Go-annotation\nAnnotation libraries and tools for golang.\n\n\n# Docs\nAnnotation 旨在设计一个适用于 golang 的 annotation 系统，实现类似 Java 的 Annotation 系统，以及常见插件，并提供一定的灵活性用于支持外部插件。\n\n使用 `Annotation@Annotation` 名字 表示使用一个具体的 annotation, 目前内置两个插件 `Description` 和 `Component`\n\n例如, 用 Annotation 系统实现的内置插件 `Component`, 实现了类似 Java 中的依赖注入功能,  具体使用请参考 examples/example_test.go\n\n```golang\n// Annotation@Component\ntype ComponentA struct {\n\tB1 *ComponentB `autowired:\"true\"` // Will populate with new(ComponentB)\n\tB2 *ComponentB `autowired:\"true\"` // Will populate with new(ComponentB)\n\tB3 *ComponentB\n}\n\n// Annotation@Component={\"type\": \"Singleton\"}\ntype ComponentB struct {\n\tC *ComponentC `autowired:\"true\"` // Will populate with NewComponentC()\n}\n\n// Annotation@Component\ntype ComponentC struct {\n\tD        *ComponentD `autowired:\"true\"` // Will populate with NewComponentD()\n\tIntValue int\n}\n\nfunc NewComponentC() *ComponentC {\n\treturn \u0026ComponentC{IntValue: 1}\n}\n\n// Annotation@Component\ntype ComponentD struct {\n\tIntValue int\n}\n\nfunc NewComponentD() (*ComponentD, error) {\n\treturn \u0026ComponentD{IntValue: 2}, nil\n}\n\n```\n\n\n# RoadMap\n[design](/docs/design.md)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fu2takey%2Fgo-annotation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fu2takey%2Fgo-annotation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fu2takey%2Fgo-annotation/lists"}