{"id":20424190,"url":"https://github.com/itpey/remo","last_synced_at":"2026-04-29T21:35:54.060Z","repository":{"id":220055634,"uuid":"707626855","full_name":"itpey/remo","owner":"itpey","description":"in-memory key-value storage with expiration capabilities.","archived":false,"fork":false,"pushed_at":"2024-06-26T19:28:24.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T15:00:23.069Z","etag":null,"topics":["database","go","high-performance","in-memory","in-memory-caching","inmemory-db","key-value","memory","redis","storage","ttl"],"latest_commit_sha":null,"homepage":"https://github.com/itpey/remo","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itpey.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-10-20T09:58:49.000Z","updated_at":"2024-08-16T08:42:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"e31593b7-6a5c-4cfd-8fd2-1b3eff297db4","html_url":"https://github.com/itpey/remo","commit_stats":null,"previous_names":["itpey/remo"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fremo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fremo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fremo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fremo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itpey","download_url":"https://codeload.github.com/itpey/remo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241966978,"owners_count":20050324,"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":["database","go","high-performance","in-memory","in-memory-caching","inmemory-db","key-value","memory","redis","storage","ttl"],"created_at":"2024-11-15T07:08:53.498Z","updated_at":"2025-12-02T23:01:21.014Z","avatar_url":"https://github.com/itpey.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[//]: # \"Attendees: itpey\"\n[//]: # \"Tags: #itpey #go #remo #golang #go-lang #n-memory #key-value #storage\"\n\n\u003ch1 align=\"center\"\u003eRemo\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/itpey/remo\"\u003e\n    \u003cimg src=\"https://pkg.go.dev/badge/github.com/itpey/remo.svg\" alt=\"Go Reference\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/itpey/remo/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/itpey/remo\" alt=\"license\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\nRemo is a Go package that provides in-memory key-value storage with expiration capabilities. It is designed to be a simple and efficient way to manage data with an optional time-to-live duration for keys.\n\u003c/p\u003e\n\n# Features\n\n- In-memory key-value storage with optional TTL (time-to-live).\n- Thread-safe operations with efficient read and write locking.\n- Automatic cleanup of expired keys.\n- Simple and straightforward API.\n\n# Installation\n\nYou can install Remo using the Go module system:\n\n```bash\ngo get github.com/itpey/remo\n```\n\n# Usage\n\n## Creating a Storage Instance\n\nTo get started, create a new instance of the Storage struct:\n\n```go\nstore := remo.New()\n```\n\n## Setting and Retrieving Values\n\nYou can use the `Set` and `Get` methods to store and retrieve key-value pairs, with the option to set a time-to-live (TTL) duration for keys.\n\n### Setting a Key with No Expiration\n\nTo set a key with no expiration, simply pass a TTL of 0:\n\n```go\n// Set a key with a value and no expiration\nstore.Set(\"myKey\", \"myValue\", 0)\n```\n\n### Setting a Key with a Specific TTL\n\nYou can also set a key with a specific TTL duration, which represents the time the key will be retained in the storage. For example, to set a key that expires in 30 minutes:\n\n```go\n// Set a key with a value and a 30-minute TTL\nstore.Set(\"myKey\", \"myValue\", 30 * time.Minute)\n```\n\n### Retrieving a Value\n\nTo retrieve a value by key, use the `Get` method. It returns the value associated with the key and an error if the key does not exist or has expired:\n\n```go\nvalue, err := store.Get(\"myKey\")\nif err != nil {\n    // Handle error (e.g., key not found or key has expired)\n} else {\n    // Use the retrieved value\n}\n```\n\n## Deleting Keys\n\nYou can delete keys using the `Delete` method:\n\n```go\nstore.Delete(\"myKey\")\n```\n\n## Automatic Cleanup\n\nRemo includes an automatic cleanup feature that removes expired keys at a specified interval. You can start and stop this feature using the following methods:\n\n```go\n// Start automatic cleanup (e.g., every 10 minutes)\nstore.StartCleanup(10 * time.Minute)\n\n// Stop automatic cleanup\nstore.StopCleanup()\n```\n\n## Resetting the Storage\n\nRemo provides a convenient `Reset` method that allows you to clear all keys from the storage. This is useful when you need to start with an empty key-value store. Here's how to use the `Reset` method:\n\n```go\nstore.Reset()\n```\n\n# Running Tests\n\nTo run tests for Remo, use the following command:\n\n```bash\ngo test github.com/itpey/remo\n```\n\n# Running Benchmarks\n\nTo run benchmarks for Remo, use the following command:\n\n```bash\ngo test -bench=. github.com/itpey/remo\n```\n\n# Feedback and Contributions\n\nIf you encounter any issues or have suggestions for improvement, please [open an issue](https://github.com/itpey/remo/issues) on GitHub.\n\nWe welcome contributions! Fork the repository, make your changes, and submit a pull request.\n\n# License\n\nRemo is open-source software released under the Apache License, Version 2.0. You can find a copy of the license in the [LICENSE](https://github.com/itpey/remo/blob/main/LICENSE) file.\n\n# Author\n\nChunker was created by [itpey](https://github.com/itpey)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitpey%2Fremo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitpey%2Fremo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitpey%2Fremo/lists"}