{"id":42202784,"url":"https://github.com/ivanzzeth/go-universal-data-containers","last_synced_at":"2026-01-27T00:28:25.602Z","repository":{"id":286286096,"uuid":"960960867","full_name":"ivanzzeth/go-universal-data-containers","owner":"ivanzzeth","description":"Universal Data Containers (UDC) provides standardized interfaces for common data structures with multiple backend implementations. It enables developers to write environment-agnostic code that can seamlessly transition between in-memory (for testing) and production-ready backends (Redis, PostgreSQL, etc.) without changing application logic.","archived":false,"fork":false,"pushed_at":"2026-01-24T04:24:55.000Z","size":186,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-24T16:02:30.418Z","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/ivanzzeth.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":"Roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-05T12:58:18.000Z","updated_at":"2026-01-24T04:24:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce7a8e0c-6cb1-42a3-bbb3-17cd5bc7ddb2","html_url":"https://github.com/ivanzzeth/go-universal-data-containers","commit_stats":null,"previous_names":["ivanzzeth/go-universal-data-containers"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/ivanzzeth/go-universal-data-containers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanzzeth%2Fgo-universal-data-containers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanzzeth%2Fgo-universal-data-containers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanzzeth%2Fgo-universal-data-containers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanzzeth%2Fgo-universal-data-containers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivanzzeth","download_url":"https://codeload.github.com/ivanzzeth/go-universal-data-containers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanzzeth%2Fgo-universal-data-containers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28793144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: 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":[],"created_at":"2026-01-27T00:28:25.479Z","updated_at":"2026-01-27T00:28:25.584Z","avatar_url":"https://github.com/ivanzzeth.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Universal Data Containers (UDC)\n\n## Overview\n**Universal Data Containers (UDC)** is a Go library that provides standardized interfaces for common data structures with multiple backend implementations. It enables developers to write environment-agnostic code that can seamlessly transition between in-memory (for testing) and production-ready backends (Redis, Kafka, PostgreSQL, etc.) without changing application logic.\n\n## Core Principles\n\n1. **Standardized Interfaces**: Well-defined contracts for each data structure\n2. **Multiple Implementations**: Memory, Redis, Kafka, and other backends\n3. **Zero-Cost Abstraction**: Minimal performance overhead\n4. **Thread Safety**: All implementations are concurrency-safe\n5. **Pluggable Architecture**: Easy to add new backends\n\n## Current Implementations\n\n### 1. Queue (Already Implemented)\n```go\ntype Queue interface {\n    Kind() Kind\n    MaxSize() int\n    Enqueue([]byte) error\n    Dequeue() ([]byte, error)\n    Subscribe(Handler)\n}\n\ntype RecoverableQueue interface {\n    Queue\n    Recover([]byte) error\n}\n```\n\n### 2. Cache (Planned)\n```go\ntype Cache interface {\n    Get(key string) ([]byte, error)\n    Set(key string, value []byte, ttl time.Duration) error\n    Delete(key string) error\n    Exists(key string) (bool, error)\n}\n```\n\n### 3. Future Structures\n- PubSub\n- Key-Value Store\n- Priority Queue\n- Rate Limiter\n\n## Usage Example\n\n### Application Code (Environment-Agnostic)\n```go\n// Initialize factory (could be memory, redis, kafka)\nfactory := udc.NewMemoryFactory() \n\n// Get queue - same interface regardless of backend\norderQueue := factory.GetQueue(\"orders\", 1000)\n\n// Get cache - same interface\nproductCache := factory.GetCache(\"products\", 10*time.Minute)\n```\n\n### Testing vs Production\n```go\n// In test (memory backend)\nfunc TestOrderProcessing(t *testing.T) {\n    factory := udc.NewMemoryFactory()\n    testQueue := factory.GetQueue(\"test-orders\", 100)\n    // Test logic...\n}\n\n// In production (Redis backend)\nfunc main() {\n    factory := udc.NewRedisFactory(\u0026RedisConfig{\n        Addr: \"redis-prod:6379\",\n    })\n    prodQueue := factory.GetQueue(\"prod-orders\", 10000)\n    // Production logic...\n}\n```\n\n## Architecture\n\n```\n[Your Application]\n    |\n    | Uses\n    v\n[UDC Interfaces] (Queue, Cache, etc.)\n    ^\n    | Implements\n    |\n[Backend Implementations]\n    ├── Memory (for testing)\n    ├── Redis (production)\n    ├── Kafka (production)\n    └── PostgreSQL (production)\n```\n\n## Benefits\n\n1. **Development Speed**: Rapid prototyping with in-memory backends\n2. **Testing Reliability**: No external dependencies in unit tests\n3. **Production Readiness**: Switch to scalable backends with config changes\n4. **Code Consistency**: Same application logic across environments\n5. **Vendor Neutral**: Avoid lock-in to specific technologies\n\n## Roadmap\n\n1. **v0.1**: Queue implementation (Memory + Redis)\n2. **v0.2**: Cache implementation (Memory + Redis)\n3. **v0.3**: PubSub implementation (Memory + Redis + Kafka)\n4. **v1.0**: Stable API with multiple production-ready backends\n\n## Contribution Guidelines\nWe welcome implementations for additional:\n- Data structures\n- Backend providers\n- Language bindings\n\n## Example Configurations\n\n```yaml\n# development.yaml\ndata_containers:\n  default_backend: memory\n  queues:\n    orders:\n      max_size: 1000\n  caches:\n    products:\n      ttl: 10m\n\n# production.yaml\ndata_containers:\n  default_backend: redis\n  redis:\n    addr: \"redis-cluster:6379\"\n  queues:\n    orders:\n      max_size: 10000\n      backend: kafka\n      kafka_topic: \"orders\"\n  caches:\n    products:\n      ttl: 1h\n```\n\nThis library follows the philosophy: \"Write once, run anywhere\" - from local development to distributed production systems.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanzzeth%2Fgo-universal-data-containers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanzzeth%2Fgo-universal-data-containers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanzzeth%2Fgo-universal-data-containers/lists"}