{"id":36892113,"url":"https://github.com/kaatinga/robinson","last_synced_at":"2026-01-12T15:38:25.440Z","repository":{"id":64298309,"uuid":"524203049","full_name":"kaatinga/robinson","owner":"kaatinga","description":"A single value thread-safe cache for any value type.","archived":false,"fork":false,"pushed_at":"2024-07-06T20:50:35.000Z","size":41,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-06T21:47:41.924Z","etag":null,"topics":["cache","golang","help-wanted","minimalistic","thread-safe"],"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/kaatinga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-08-12T19:29:43.000Z","updated_at":"2024-07-06T20:50:37.000Z","dependencies_parsed_at":"2024-01-05T12:32:02.284Z","dependency_job_id":"cb64794d-b4b7-4514-a619-f2802be8fca4","html_url":"https://github.com/kaatinga/robinson","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kaatinga/robinson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaatinga%2Frobinson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaatinga%2Frobinson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaatinga%2Frobinson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaatinga%2Frobinson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaatinga","download_url":"https://codeload.github.com/kaatinga/robinson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaatinga%2Frobinson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cache","golang","help-wanted","minimalistic","thread-safe"],"created_at":"2026-01-12T15:38:22.320Z","updated_at":"2026-01-12T15:38:25.431Z","avatar_url":"https://github.com/kaatinga.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Tests](https://github.com/kaatinga/robinson/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/kaatinga/robinson/actions/workflows/test.yml)\n[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/kaatinga/robinson/blob/main/LICENSE)\n[![codecov](https://codecov.io/gh/kaatinga/robinson/graph/badge.svg?token=Y8N1RI9SEF)](https://codecov.io/gh/kaatinga/robinson)\n[![lint workflow](https://github.com/kaatinga/robinson/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/kaatinga/robinson/actions?query=workflow%3Alinter)\n[![help wanted](https://img.shields.io/badge/Help%20wanted-True-yellow.svg)](https://github.com/robinson/strconv/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)\n\n# Robinson\n\n## Overview\n\nThe \"Robinson\" package is a lightweight Golang package that provides a thread-safe cache implementation for storing and retrieving values of any type. Robinson supports evicting the stored values.\n\n## Features\n\n- Thread-Safe Caching: The Robinson package offers a thread-safe cache that allows concurrent access from multiple goroutines without the risk of data corruption or race conditions. It provides synchronized operations to ensure safe and reliable caching in concurrent environments.\n- Strong Typing: With Go generics, the cache enforces strong typing, meaning that once the cache is created, it can only store and retrieve values of the exact type specified during initialization. This ensures type safety and prevents accidental data mismatches or type-related errors.\n- Error-Free Operation: The Robinson library is designed to provide a seamless and error-free caching experience. It handles internal operations and resource management efficiently, reducing the possibility of unexpected errors or exceptions during cache operations.\n- Zero Dependencies: The package has been developed to be lightweight and self-contained, with no external dependencies. It minimizes the overall package size and simplifies integration into your projects, avoiding potential conflicts or compatibility issues with other libraries.\n\n## Installation\n\nTo install the Robinson package, use the following command:\n\n```shell\ngo get github.com/kaatinga/robinson\n```\n\n## Usage\n\nTo use the Robinson package in your Go projects, import it into your code:\n\n```go\nimport \"github.com/kaatinga/robinson\"\n```\n\nTo create a new cache, use the `NewCrusoe()` function:\n\n```go\nvalue := 123\n\n// Create a cache for storing integer value\ncrusoe := NewCrusoe[int]()\n\n// Set the value in the cache\ncrusoe.Set(value)\n\n// Get the value from the cache\ncacheValue := crusoe.Get()\n```\n\nTo apply atomic operations to the cache, use the `Call()` method:\n\n```go\nvalue := 123\n\n// Create a cache for storing integer value\ncrusoe := NewCrusoe[int]()\ncrusoe.Set(value)\n\n// Increment the value in the cache\ncrusoe.Call(func(v int) int {\n    return v + 1\n})\n```\n\nor you can use `CallWithError()` method:\n\n```go\nvalue := 123\n\n// Create a cache for storing integer value\ncrusoe := NewCrusoe[int]()\ncrusoe.Set(value)\n\n// Increment the value in the cache\ncrusoe.CallWithError(func(v int) (int, error) {\n\tif v == 0 {\n\t\treturn 0, errors.New(\"value is zero\")\n\t}\n    return v + 1, nil\n})\n```\n\nIn this particular case you might use atomic package to increment value, but it's just an example. The passed function may be intricate and complex as well as the value type.\n\nWhether you need to implement a simple in-memory cache for your application or require a thread-safe caching solution for concurrent operations, the Robinson package provides a reliable and efficient caching mechanism. Its minimalistic design, strong typing, and error-free operation make it a valuable tool for improving performance and enhancing data management in your Go projects.\n\n## License\n\nThe \"Robinson\" package is an open-source software released under the [MIT](LICENSE) License. The original author is Michael Gunkoff.\n\n## Contributing\n\nIf you want to contribute to the project, please read the [Contributing Guide](CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaatinga%2Frobinson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaatinga%2Frobinson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaatinga%2Frobinson/lists"}