{"id":18326525,"url":"https://github.com/ghosind/collection","last_synced_at":"2025-04-09T16:25:43.137Z","repository":{"id":49333711,"uuid":"515916142","full_name":"ghosind/collection","owner":"ghosind","description":"Generics collections framework for Golang.","archived":false,"fork":false,"pushed_at":"2025-04-03T09:54:51.000Z","size":118,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T10:35:42.754Z","etag":null,"topics":["collections","collections-framework","generics-collections","generics-in-golang","golang","golang-collections","golang-library"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/ghosind/collection","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/ghosind.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,"publiccode":null,"codemeta":null}},"created_at":"2022-07-20T09:27:23.000Z","updated_at":"2025-04-03T09:51:08.000Z","dependencies_parsed_at":"2024-12-17T09:30:25.510Z","dependency_job_id":"496fe8f8-cfe7-45d1-bdc4-31b55bfcd7c4","html_url":"https://github.com/ghosind/collection","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosind%2Fcollection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosind%2Fcollection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosind%2Fcollection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosind%2Fcollection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghosind","download_url":"https://codeload.github.com/ghosind/collection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248066360,"owners_count":21042095,"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":["collections","collections-framework","generics-collections","generics-in-golang","golang","golang-collections","golang-library"],"created_at":"2024-11-05T19:07:11.085Z","updated_at":"2025-04-09T16:25:43.120Z","avatar_url":"https://github.com/ghosind.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# collection\n\n![Test](https://github.com/ghosind/collection/workflows/collection/badge.svg)\n[![codecov](https://codecov.io/gh/ghosind/collection/branch/main/graph/badge.svg)](https://codecov.io/gh/ghosind/collection)\n[![Latest version](https://img.shields.io/github/v/release/ghosind/collection?include_prereleases)](https://github.com/ghosind/collection)\n![License Badge](https://img.shields.io/github/license/ghosind/collection)\n[![Go Reference](https://pkg.go.dev/badge/github.com/ghosind/collection.svg)](https://pkg.go.dev/github.com/ghosind/collection)\n\nGenerics collections framework for Golang.\n\n\u003e IMPORTANT NOTICE: This package requires Go version 1.18+.\n\n## Overview\n\nThis package provides the following data structure interfaces and implementations:\n\n- `Collection`: The root interface of most of the structures in this package (without `Dictionary`).\n\n- `Set`: A collection interface that contains no duplicate elements.\n\n    - [`HashSet`](https://pkg.go.dev/github.com/ghosind/collection/set#HashSet): The implementation of Set based on Go built-in map structure.\n\n    - [`SyncSet`](https://pkg.go.dev/github.com/ghosind/collection/set#SyncSet): The thread safe implementation of Set based on `sync.Map`.\n\n- `Dict`: A object that maps keys to values, and it cannot contain duplicate key.\n\n    - [`HashDict`](https://pkg.go.dev/github.com/ghosind/collection/dict#HashDict): The implementation of Dictionary based on Go built-in map structure.\n\n    - [`SyncDict`](https://pkg.go.dev/github.com/ghosind/collection/dict#SyncDict): The thread safe implementation of dictionary based on `sync.Map`.\n\n## Installation\n\nYou can install this package by the following command.\n\n```sh\ngo get -u github.com/ghosind/collection\n```\n\nAfter installation, you can import it by the following code.\n\n```go\nimport \"github.com/ghosind/collection\"\n```\n\n## Examples\n\n### HashSet Examples\n\nCreate a string set, add and test elements in the set.\n\n```go\n// import \"github.com/ghosind/collection/set\"\n\nfruits := set.NewHashSet[string]()\n\nfruits.Add(\"Apple\")\nfruits.Add(\"Banana\")\n\nlog.Print(fruits.Contains(\"Banana\")) // true\nlog.Print(fruits.Contains(\"Lemon\"))\n```\n\n### HashDictionary Examples\n\n```go\n// import \"github.com/ghosind/collection/dict\"\n\nlanguages := dict.NewHashDict[string, int]()\n\nlanguages.Put(\"C\", 1972)\nlanguages.Put(\"Go\", 2007)\n\nlog.Print(languages.GetDefault(\"C\", 0)) // 1972\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghosind%2Fcollection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghosind%2Fcollection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghosind%2Fcollection/lists"}