{"id":16949933,"url":"https://github.com/jackc/cachet","last_synced_at":"2025-03-21T10:20:24.373Z","repository":{"id":176678572,"uuid":"612623627","full_name":"jackc/cachet","owner":"jackc","description":"The cache for all your Ts","archived":false,"fork":false,"pushed_at":"2023-03-11T21:19:47.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T06:43:17.548Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackc.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":"2023-03-11T13:58:19.000Z","updated_at":"2024-04-15T11:52:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"b2a4ead4-bc37-4432-ace8-e6ff47fad54b","html_url":"https://github.com/jackc/cachet","commit_stats":null,"previous_names":["jackc/cachet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fcachet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fcachet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fcachet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fcachet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackc","download_url":"https://codeload.github.com/jackc/cachet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244776342,"owners_count":20508507,"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-10-13T21:56:25.350Z","updated_at":"2025-03-21T10:20:24.352Z","avatar_url":"https://github.com/jackc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/jackc/cachet.svg)](https://pkg.go.dev/github.com/jackc/cachet)\n![Build Status](https://github.com/jackc/cachet/actions/workflows/ci.yml/badge.svg)\n\n# CacheT\n\nCacheT is a tiny, generic cache. It was initially designed to assist with live reloading HTML templates in development\nwhile caching them in production.\n\n## Example Usage\n\n```go\nvalue := 0\nisStale := false\ncache := cachet.Cache[int]{\n  Load: func() (int, error) {\n    value++\n    return value, nil\n  },\n  IsStale: func() (bool, error) {\n    return isStale, nil\n  },\n}\n\ncache.MustGet() // =\u003e 1\ncache.MustGet() // =\u003e 1\nisStale = true\ncache.MustGet() // =\u003e 2\ncache.MustGet() // =\u003e 3\nisStale = false\ncache.MustGet() // =\u003e 3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackc%2Fcachet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackc%2Fcachet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackc%2Fcachet/lists"}