{"id":20208057,"url":"https://github.com/gkampitakis/go-tiny-lru","last_synced_at":"2026-06-07T03:31:22.946Z","repository":{"id":116153936,"uuid":"298675251","full_name":"gkampitakis/go-tiny-lru","owner":"gkampitakis","description":"A replication of tiny-lru npm package in golang","archived":false,"fork":false,"pushed_at":"2020-11-20T17:36:19.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-06T06:37:13.123Z","etag":null,"topics":["go-module","golang","lru-cache"],"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/gkampitakis.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-09-25T20:41:05.000Z","updated_at":"2024-06-19T12:38:24.850Z","dependencies_parsed_at":null,"dependency_job_id":"d38da438-5fa4-4428-8f41-b4f7f577541b","html_url":"https://github.com/gkampitakis/go-tiny-lru","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkampitakis%2Fgo-tiny-lru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkampitakis%2Fgo-tiny-lru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkampitakis%2Fgo-tiny-lru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkampitakis%2Fgo-tiny-lru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gkampitakis","download_url":"https://codeload.github.com/gkampitakis/go-tiny-lru/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241644554,"owners_count":19996179,"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":["go-module","golang","lru-cache"],"created_at":"2024-11-14T05:33:55.543Z","updated_at":"2026-06-07T03:31:22.908Z","avatar_url":"https://github.com/gkampitakis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Tiny LRU\n\nThis go module is a replication of [tiny-lru](https://www.npmjs.com/package/tiny-lru) written in js.\n\n## Description\n\nTrying to learn basic concepts of golang, implement tests and benchmarks.\n\n## Usage\n\n```bash\ngo get -u github.com/gkampitakis/go-tiny-lru\n```\nThen you can use it in your code \n\n```go\n\nimport \"github.com/gkampitakis/go-tiny-lru\"\n\nLRU.New(10,1000)\n// First parameter is the max items that LRU can store\n// and the second is the ttl number. \n//You can set them both to zero for no max capacity and no ttl.\n```\n\n## Methods\n\n### New\n\nCreates a new LRU instance. \n\u003cbr\u003e\n**Parameters:** `max int`,`ttl int64`. max and ttl can be set to zero for \nspecifying \"infinite\" capacity and no expiration time. \n\u003cbr\u003e\n**Returns:** `error,*LRU`\n\n### Clear\n\nClears LRU and resets all values. \n\u003cbr\u003e\n**Parameters:** -\n\u003cbr\u003e\n**Returns:** `*LRU`\n\n### Delete\n\nDeletes key from LRU if existent.\n\u003cbr\u003e\n**Parameters:** `key string`\n\u003cbr\u003e\n**Returns:** `*LRU`\n\n### Keys\n\nReturns a slice containing all keys in LRU.\n\u003cbr\u003e\n**Note:** the order of insertion is not guaranteed in the output slice as internally LRU uses maps for storing items.\n\u003cbr\u003e\n**Parameters:** -\n\u003cbr\u003e\n**Returns:** `[]string`\n\n### Set\n\nAdds a new item in LRU.\n\u003cbr\u003e\n**Parameters:** `key string`,`value interface{}`\n\u003cbr\u003e\n**Returns:** `*LRU`\n\n### Get\n\nReturns the value of a key if existent\n\u003cbr\u003e\n**Parameters:** `key string`\n\u003cbr\u003e\n**Returns:** `interface{} || nil`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkampitakis%2Fgo-tiny-lru","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgkampitakis%2Fgo-tiny-lru","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkampitakis%2Fgo-tiny-lru/lists"}