{"id":19241080,"url":"https://github.com/binocarlos/flocker-cache","last_synced_at":"2025-02-23T14:28:05.014Z","repository":{"id":19667635,"uuid":"22921105","full_name":"binocarlos/flocker-cache","owner":"binocarlos","description":"An in-memory cache for flocker routing","archived":false,"fork":false,"pushed_at":"2014-08-13T15:42:21.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T02:54:24.853Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binocarlos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-13T15:42:02.000Z","updated_at":"2014-08-13T15:42:21.000Z","dependencies_parsed_at":"2022-08-24T14:07:39.150Z","dependency_job_id":null,"html_url":"https://github.com/binocarlos/flocker-cache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fflocker-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fflocker-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fflocker-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fflocker-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binocarlos","download_url":"https://codeload.github.com/binocarlos/flocker-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240326758,"owners_count":19783903,"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-11-09T17:10:11.402Z","updated_at":"2025-02-23T14:28:04.989Z","avatar_url":"https://github.com/binocarlos.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## flocker-cache\n\nAn in-memory cache for [flocker](https://github.com/binocarlos/flocker.git) that routes requests to /images/create onto the same server as the previous /containers/create request\n\n## install\n\n```\n$ npm install flocker-cache\n```\n\n## usage\n\n```js\nvar http = require('http')\nvar flocker = require(\"flocker\")\nvar flockercache = require(\"flocker-cache\")\n\nvar dockers = flocker()\n\n// the flockercache will remember routing decisions for images\ndockers.on('route', flockercache(function(info, done){\n\tcustomRoutingLogic(info, done)\n}))\n\ndockers.on('map', function(name, container, image, next){\n\tnext()\n})\n\ndockers.on('list', function(next){\n\tnext(null, serverList)\n})\n\nvar server = http.createServer(function(req, res){\n\tdockers.handle(req, res)\t\n})\n\nserver.listen(80)\n```\n\nthe cache will keep state between subsequent /containers/create and /images/create requests and route them to the correct address\n\n## license\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinocarlos%2Fflocker-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinocarlos%2Fflocker-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinocarlos%2Fflocker-cache/lists"}