{"id":22018587,"url":"https://github.com/codeofnode/lru-go","last_synced_at":"2025-03-23T09:29:39.942Z","repository":{"id":93589372,"uuid":"264491215","full_name":"codeofnode/lru-go","owner":"codeofnode","description":"LRU caching in golang","archived":false,"fork":false,"pushed_at":"2020-05-16T17:38:14.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T16:17:44.729Z","etag":null,"topics":[],"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/codeofnode.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":"2020-05-16T17:36:30.000Z","updated_at":"2020-05-16T17:38:48.000Z","dependencies_parsed_at":"2023-04-05T13:30:19.446Z","dependency_job_id":null,"html_url":"https://github.com/codeofnode/lru-go","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/codeofnode%2Flru-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeofnode%2Flru-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeofnode%2Flru-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeofnode%2Flru-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeofnode","download_url":"https://codeload.github.com/codeofnode/lru-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245081866,"owners_count":20557861,"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-11-30T05:12:40.588Z","updated_at":"2025-03-23T09:29:39.891Z","avatar_url":"https://github.com/codeofnode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lru-go\nlru implementation in golang\n\n# API docs\n1. First init a cache with size\n```\nc, er := lru.New(\u003csize\u003e)\n```\nc, the cache instance\ner, if cache creation had any error\n\n2. Add to cache\n```\nwasThereAnyEviction = c.Add(\u003cany_string_value\u003e)\n```\nwasThereAnyEviction, (bool) that tells whether there was an eviction for adding cache\n\n3. Query to cache\n```\nval, ok = c.Query(\u003cany_string_value\u003e)\n```\nval, the value against the query (defaults to empty string \"\", if in case query not found)\nok, if query has corresponding value or not\n\n# dir structure\n* main.go -\u003e the lru cache\n* main_test.go -\u003e the test files\n\n# dependencies\n* go 1.14+\n\n## dev dependencies\n* make 4.1+\n* inotifywait 3.14\n\n# testing\nAll modules has their `*_test` files as UT.\nrun tests with\n\n```\nmake test\n```\n\n# TODO\n* complete testing with full coverage\n* use mutex locks for concurrency protection\n* use separate key value for storing into in cache\n* use persistent storage\n* more to discuss\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeofnode%2Flru-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeofnode%2Flru-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeofnode%2Flru-go/lists"}