{"id":19501171,"url":"https://github.com/gitbookio/diskache","last_synced_at":"2025-08-09T10:37:30.872Z","repository":{"id":57496232,"uuid":"48115622","full_name":"GitbookIO/diskache","owner":"GitbookIO","description":"Lightweight Golang disk cache","archived":false,"fork":false,"pushed_at":"2016-10-28T14:49:15.000Z","size":3,"stargazers_count":13,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T05:11:09.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/GitbookIO.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}},"created_at":"2015-12-16T14:37:36.000Z","updated_at":"2023-07-25T13:59:19.000Z","dependencies_parsed_at":"2022-08-28T20:20:48.556Z","dependency_job_id":null,"html_url":"https://github.com/GitbookIO/diskache","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/GitbookIO%2Fdiskache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fdiskache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fdiskache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fdiskache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GitbookIO","download_url":"https://codeload.github.com/GitbookIO/diskache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250912660,"owners_count":21506865,"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-10T22:11:42.900Z","updated_at":"2025-04-25T23:31:01.712Z","avatar_url":"https://github.com/GitbookIO.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# diskache\n\nLightweight Golang disk cache.\n\n## Get\n\n```Shell\n$ go get github.com/GitbookIO/diskache\n```\n\n## Use\n\n```Go\nimport (\n    \"fmt\"\n    \"github.com/GitbookIO/diskache\"\n)\n\n// Create an instance\nopts := diskache.Opts{\n    Directory: \"diskache_place\",\n}\ndc := diskache.New(opts)\n\n// Add data to cache\nspelling := []byte{'g', 'o', 'l', 'a', 'n', 'g'}\nerr := dc.Set(\"spelling\", spelling)\nif err != nil {\n    fmt.Println(\"Impossible to set data in cache\")\n}\n\n// Read from cache\ncached, inCache := dc.Get(\"spelling\")\nif inCache {\n    fmt.Println(string(cached))\n}\n\n// Read stats\nstats := dc.Stats()\nreflect.DeepEqual(stats, Stats{\n    Directory: \"diskache_place\",\n    Items:     1,\n})\n\n// Cleanup\nerr = dc.Clean()\nif err != nil {\n    fmt.Println(\"Impossible to clean cache\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitbookio%2Fdiskache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitbookio%2Fdiskache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitbookio%2Fdiskache/lists"}