{"id":25650806,"url":"https://github.com/clustercockpit/cc-lib","last_synced_at":"2026-02-10T16:16:42.514Z","repository":{"id":277864297,"uuid":"933675991","full_name":"ClusterCockpit/cc-lib","owner":"ClusterCockpit","description":"Common golang packages","archived":false,"fork":false,"pushed_at":"2026-01-13T05:55:39.000Z","size":608,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-13T08:44:46.649Z","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/ClusterCockpit.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-02-16T12:48:04.000Z","updated_at":"2025-12-24T08:27:49.000Z","dependencies_parsed_at":"2025-04-22T17:29:01.887Z","dependency_job_id":"e85dda94-44ef-43ce-82b5-7477edee2ca2","html_url":"https://github.com/ClusterCockpit/cc-lib","commit_stats":null,"previous_names":["clustercockpit/cc-lib"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/ClusterCockpit/cc-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClusterCockpit%2Fcc-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClusterCockpit%2Fcc-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClusterCockpit%2Fcc-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClusterCockpit%2Fcc-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClusterCockpit","download_url":"https://codeload.github.com/ClusterCockpit/cc-lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClusterCockpit%2Fcc-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28815385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"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":"2025-02-23T15:18:43.174Z","updated_at":"2026-01-27T15:06:08.216Z","avatar_url":"https://github.com/ClusterCockpit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\ntitle: cc-lib\ndescription: Component library for various ClusterCockpit applications\ncategories: [cc-lib]\ntags: ['Admin', 'Developer']\nweight: 1\nhugo_path: docs/reference/cc-lib/_index.md\n--\u003e\n\n[![GoDoc](https://godoc.org/github.com/ClusterCockpit/cc-lib/v2?status.svg)](https://godoc.org/github.com/ClusterCockpit/cc-lib/v2)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ClusterCockpit/cc-lib/v2)](https://goreportcard.com/report/github.com/ClusterCockpit/cc-lib/v2)\n\n# cc-lib\n\nCommon ClusterCockpit golang packages providing reusable components for building HPC monitoring and metric collection applications.\n\n## Overview\n\ncc-lib is a collection of Go packages developed for the [ClusterCockpit](https://github.com/ClusterCockpit) project. These packages provide essential functionality for:\n\n- **Metric Collection**: Receivers for various protocols (IPMI, Redfish, Prometheus, etc.)\n- **Data Processing**: Message processing pipelines, resampling, and transformations\n- **Data Storage**: Sinks for InfluxDB, NATS, Prometheus, and more\n- **Configuration**: Flexible configuration management with validation\n- **Utilities**: Caching, logging, topology detection, and helper functions\n\nThe library is designed to be modular, allowing you to use individual packages as needed in your own projects.\n\n## Packages\n\n### Core Messaging \u0026 Processing\n\n| Package                                | Description                                                                 |\n| -------------------------------------- | --------------------------------------------------------------------------- |\n| [ccMessage](./ccMessage)               | Message types and protocols for metrics, logs, events, and control messages |\n| [messageProcessor](./messageProcessor) | Expression-based message processing and transformation pipeline             |\n| [schema](./schema)                     | JSON schema definitions and validation for ClusterCockpit data structures   |\n\n### Metric Collection\n\n| Package                    | Description                                                         |\n| -------------------------- | ------------------------------------------------------------------- |\n| [receivers](./receivers)   | Metric receivers for IPMI, Redfish, Prometheus, and other protocols |\n| [ccTopology](./ccTopology) | System topology detection and hardware information gathering        |\n\n### Data Storage \u0026 Output\n\n| Package                  | Description                                                        |\n| ------------------------ | ------------------------------------------------------------------ |\n| [sinks](./sinks)         | Metric sinks for InfluxDB, NATS, Prometheus, HTTP, and file output |\n| [resampler](./resampler) | Data resampling and aggregation utilities                          |\n\n### Configuration \u0026 Logging\n\n| Package                | Description                                              |\n| ---------------------- | -------------------------------------------------------- |\n| [ccConfig](./ccConfig) | Configuration file management with hot-reloading support |\n| [ccLogger](./ccLogger) | Structured logging with multiple output levels           |\n\n### Utilities\n\n| Package                | Description                                                             |\n| ---------------------- | ----------------------------------------------------------------------- |\n| [lrucache](./lrucache) | Thread-safe LRU cache with TTL support and HTTP middleware              |\n| [hostlist](./hostlist) | Hostlist expansion for compact host specifications (e.g., `node[1-10]`) |\n| [ccUnits](./ccUnits)   | Unit conversion and handling for metrics                                |\n| [util](./util)         | Common utility functions and helpers                                    |\n| [runtime](./runtime)   | Runtime environment setup, privilege dropping, and systemd integration  |\n\n## Installation\n\n```bash\ngo get github.com/ClusterCockpit/cc-lib/v2\n```\n\n**Requirements:**\n\n- Go 1.24.0 or higher\n\n## Quick Start\n\n### Using the LRU Cache\n\n```go\nimport \"github.com/ClusterCockpit/cc-lib/v2/lrucache\"\n\ncache := lrucache.New(1000) // maxmemory in arbitrary units\n\nvalue := cache.Get(\"key\", func() (interface{}, time.Duration, int) {\n    // Compute expensive value\n    result := fetchFromDatabase()\n    return result, 10 * time.Minute, len(result)\n})\n```\n\n### Expanding Hostlists\n\n```go\nimport \"github.com/ClusterCockpit/cc-lib/v2/hostlist\"\n\nhosts, err := hostlist.Expand(\"node[1-10],gpu[1-4]\")\n// Returns: [gpu1, gpu2, gpu3, gpu4, node1, node2, ..., node10]\n```\n\n### Creating Messages\n\n```go\nimport \"github.com/ClusterCockpit/cc-lib/v2/ccMessage\"\n\nmsg, err := ccMessage.NewMessage(\n    \"temperature\",\n    map[string]string{\"hostname\": \"node01\", \"type\": \"node\"},\n    map[string]string{\"unit\": \"degC\"},\n    map[string]interface{}{\"value\": 45.2},\n    time.Now(),\n)\n```\n\n### Using Configuration Management\n\n```go\nimport \"github.com/ClusterCockpit/cc-lib/v2/ccConfig\"\n\nconfig := ccConfig.New()\nconfig.AddFile(\"config.json\")\n\n// Access configuration\nvalue := config.Get(\"key\")\n\n// Watch for changes\nconfig.Watch(func() {\n    log.Println(\"Configuration changed\")\n})\n```\n\n## Documentation\n\n- **API Documentation**: [pkg.go.dev/github.com/ClusterCockpit/cc-lib/v2](https://pkg.go.dev/github.com/ClusterCockpit/cc-lib/v2)\n- **Package READMEs**: Each package has its own README with detailed documentation and examples\n\n### Package Documentation\n\n- [ccConfig](./ccConfig/README.md) - Configuration management\n- [ccLogger](./ccLogger/README.md) - Logging utilities\n- [ccMessage](./ccMessage/README.md) - Message types and protocols\n- [ccTopology](./ccTopology/README.md) - System topology detection\n- [ccUnits](./ccUnits/README.md) - Unit conversion\n- [hostlist](./hostlist/README.md) - Hostlist expansion\n- [lrucache](./lrucache/README.md) - LRU cache with TTL\n- [messageProcessor](./messageProcessor/README.md) - Message processing\n- [receivers](./receivers/README.md) - Metric receivers\n- [runtime](./runtime/README.md) - Runtime environment setup\n- [schema](./schema/README.md) - JSON schema validation\n- [sinks](./sinks/README.md) - Metric sinks\n- [util](./util/README.md) - Utility functions\n\n## Testing\n\nRun all tests:\n\n```bash\ngo test ./...\n```\n\nRun tests with coverage:\n\n```bash\ngo test -cover ./...\n```\n\nRun tests for a specific package:\n\n```bash\ngo test -v ./lrucache\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues and pull requests.\n\n### Development\n\n1. Clone the repository\n2. Make your changes\n3. Run tests: `go test ./...`\n4. Submit a pull request\n\n## Projects Using cc-lib\n\n- [cc-metric-collector](https://github.com/ClusterCockpit/cc-metric-collector) - Metric collection daemon\n- [cc-metric-store](https://github.com/ClusterCockpit/cc-metric-store) - Metric storage backend\n- [ClusterCockpit](https://github.com/ClusterCockpit/ClusterCockpit) - Web interface and monitoring system\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\nCopyright (C) NHR@FAU, University Erlangen-Nuremberg.\n\n## Acknowledgments\n\nDeveloped by the [National High Performance Computing (NHR) center at FAU](https://hpc.fau.de/).\n\nAdditional contributors:\n\n- Holger Obermaier (NHR@KIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclustercockpit%2Fcc-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclustercockpit%2Fcc-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclustercockpit%2Fcc-lib/lists"}