{"id":13842299,"url":"https://github.com/projectdiscovery/hmap","last_synced_at":"2026-02-01T02:04:33.729Z","repository":{"id":39888249,"uuid":"305146241","full_name":"projectdiscovery/hmap","owner":"projectdiscovery","description":"Hybrid memory/disk map","archived":false,"fork":false,"pushed_at":"2025-04-07T06:06:07.000Z","size":370,"stargazers_count":55,"open_issues_count":0,"forks_count":16,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-12T23:39:12.429Z","etag":null,"topics":["lib"],"latest_commit_sha":null,"homepage":"","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/projectdiscovery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-10-18T16:30:33.000Z","updated_at":"2025-04-07T06:06:10.000Z","dependencies_parsed_at":"2023-10-01T02:46:15.162Z","dependency_job_id":"2d553b68-ed7b-4264-b403-a30770e48c76","html_url":"https://github.com/projectdiscovery/hmap","commit_stats":{"total_commits":156,"total_committers":11,"mean_commits":"14.181818181818182","dds":0.4807692307692307,"last_synced_commit":"7325fddd216f2f6d8f21c1a730e3bca1ed0563b5"},"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fhmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fhmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fhmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fhmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectdiscovery","download_url":"https://codeload.github.com/projectdiscovery/hmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647255,"owners_count":21139081,"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":["lib"],"created_at":"2024-08-04T17:01:31.424Z","updated_at":"2026-02-01T02:04:28.709Z","avatar_url":"https://github.com/projectdiscovery.png","language":"Go","readme":"# hmap\n\nHybrid memory/disk map that helps you to manage key value storage for input deduplication.\n\n---\n\nAvailable functions:\n\n|Name|Declaration/Params/Return|\n|-|-|\n|New|func New(options Options) (*HybridMap, error){}|\n|Close|func (hm *HybridMap) Close() error{}|\n|Set|func (hm *HybridMap) Set(k string, v []byte) error{}|\n|Get|func (hm *HybridMap) Get(k string) ([]byte, bool){}|\n|Del|func (hm *HybridMap) Del(key string) error{}|\n|Scan|func (hm *HybridMap) Scan(f func([]byte, []byte) error){}|\n|Size|func (hm *HybridMap) Size() int64{}|\n|TuneMemory|func (hm *HybridMap) TuneMemory(){}|\n\nAvailable options:\n\n```go\nconst (\n\tMemory MapType = iota\n\tDisk\n\tHybrid\n)\n\ntype DBType int\n\nconst (\n\tLevelDB DBType = iota\n\tPogrebDB\n\tBBoltDB\n\tBuntDB\n)\n```\n\n|Name|Props|\n|-|-|\n|`DefaultOptions`|- Type: Memory\u003cbr\u003e- MemoryExpirationTime: time.Duration(5) * time.Minute\u003cbr\u003e- JanitorTime:          time.Duration(1) * time.Minute|\n|`DefaultMemoryOptions`|- Type: Memory|\n|`DefaultDiskOptions`|- Type: Disk\u003cbr\u003e- DBType: LevelDB\u003cbr\u003e- Cleanup: true\u003cbr\u003e- RemoveOlderThan: 24* time.Hour *2|\n|`DefaultDiskOptions`|- Type: Hybrid\u003cbr\u003e- DBType: PogrebDB\u003cbr\u003e- MemoryExpirationTime: time.Duration(5) * time.Minute\u003cbr\u003e- JanitorTime: time.Duration(1) * time.Minute|\n\nCustom options:\n```go\ntype Options struct {\n\tMemoryExpirationTime time.Duration\n\tDiskExpirationTime   time.Duration\n\tJanitorTime          time.Duration\n\tType                 MapType\n\tDBType               DBType\n\tMemoryGuardForceDisk bool\n\tMemoryGuard          bool\n\tMaxMemorySize        int\n\tMemoryGuardTime      time.Duration\n\tPath                 string\n\tCleanup              bool\n\tName                 string\n\tRemoveOlderThan time.Duration\n}\n```\n\n# Simple usage example\n\n```go\nfunc main() {\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\tgo normal(\u0026wg)\n\twg.Wait()\n}\n\nfunc normal(wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\thm, err := hybrid.New(hybrid.DefaultOptions)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer hm.Close()\n\terr2 := hm.Set(\"a\", []byte(\"b\"))\n\tif err2 != nil {\n\t\tlog.Fatal(err2)\n\t}\n\tv, ok := hm.Get(\"a\")\n\tif ok {\n\t\tlog.Println(v)\n\t}\n}\n```\n\n# License\nhmap is distributed under MIT License","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Fhmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectdiscovery%2Fhmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Fhmap/lists"}