{"id":15419502,"url":"https://github.com/jonathanbeber/lru-cache","last_synced_at":"2025-06-15T21:33:57.639Z","repository":{"id":101108468,"uuid":"278919860","full_name":"jonathanbeber/lru-cache","owner":"jonathanbeber","description":"Least Recently Used cache implementation using Go","archived":false,"fork":false,"pushed_at":"2020-07-13T13:29:13.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T03:44:38.814Z","etag":null,"topics":["algorithms-and-data-structures","cache","double-linked-list","doubly-linked-list","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonathanbeber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-11T18:29:42.000Z","updated_at":"2020-07-13T15:33:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce2a03dd-180c-493f-b5f3-975cf7dc0a4c","html_url":"https://github.com/jonathanbeber/lru-cache","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"19fdaf3f38f9fca11ec47c4ef6b77434cace272f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonathanbeber/lru-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanbeber%2Flru-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanbeber%2Flru-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanbeber%2Flru-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanbeber%2Flru-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanbeber","download_url":"https://codeload.github.com/jonathanbeber/lru-cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanbeber%2Flru-cache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260053380,"owners_count":22951866,"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":["algorithms-and-data-structures","cache","double-linked-list","doubly-linked-list","go","golang"],"created_at":"2024-10-01T17:25:15.220Z","updated_at":"2025-06-15T21:33:57.599Z","avatar_url":"https://github.com/jonathanbeber.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lru-cache\n\n**L**east **R**ecently **U**sed cache implementation using Go. It's a proof of concept and shouldn't be used in production environments.\n\n## Using it\n\nIt exports one struct `github.com/jonathanbeber/lru-cache/lru`.`Cache`. Its constructor receives the maximum number of items to cache, a `WrappableFunction` and a `Logger`. Check the code documentation for more details (`godoc`). After creating a `lru.Cache` object, eg `lruc`, invoke the wrapped function with `lruc.Do(key)`.\n\nFor better understanding, read the example code in `./example` and run the factorial one with the command `make factorial`.\n\n# Development\n\n## Pre-requisites\n\nThis application is developed to go 1.14. Check the [official docs](https://golang.org/doc/install) for details on how to install it.\nIt uses [golangci-lint][0] and [golint][1] for code analyzes. It'll install them when running `make lint` or `make test` if the commands are not found.\n\n## Commands\n\nThe Makefile contains some commands for better productivity:\n\n* To test the application use `make test`. It will run all the unit tests available. It will also run the following commands, available as separated `make` commands:\n  * `make fmt`: format all files using `gofmt` tool. It'll apply changes to the files. This project aggress on ceding control over minutiae of hand-formatting in favour of the `gofmt` tool result;\n  * `make vet`: examines Go source code and reports suspicious constructs;\n  * `make lint`:  runs the [golangci-lint][0] and the [golint][1] tool;\n* `make factorial` run the code in `./examples/factorial`.\n\n[0]: https://github.com/golangci/golangci-lint\n[1]: https://github.com/golang/lint\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanbeber%2Flru-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanbeber%2Flru-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanbeber%2Flru-cache/lists"}