{"id":20546061,"url":"https://github.com/axyz/golaroid","last_synced_at":"2026-02-21T23:07:17.630Z","repository":{"id":149336353,"uuid":"83247806","full_name":"axyz/golaroid","owner":"axyz","description":"image processing microservice","archived":false,"fork":false,"pushed_at":"2017-03-29T13:05:51.000Z","size":8,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T10:13:18.795Z","etag":null,"topics":["golang","image","media","microservice","processing","resize","server"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/axyz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-02-26T23:16:03.000Z","updated_at":"2017-05-22T09:42:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ad99925-594b-43db-a4aa-c9091cb9e9a1","html_url":"https://github.com/axyz/golaroid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/axyz/golaroid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axyz%2Fgolaroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axyz%2Fgolaroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axyz%2Fgolaroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axyz%2Fgolaroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axyz","download_url":"https://codeload.github.com/axyz/golaroid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axyz%2Fgolaroid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29697117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T18:18:25.093Z","status":"ssl_error","status_checked_at":"2026-02-21T18:18:22.435Z","response_time":107,"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":["golang","image","media","microservice","processing","resize","server"],"created_at":"2024-11-16T01:55:25.654Z","updated_at":"2026-02-21T23:07:17.625Z","avatar_url":"https://github.com/axyz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# golaroid\nmedia transformation service\n\n## Usage\nBasic usage with common included modules\n```go\npackage main\n\nimport (\n\t\"runtime\"\n\n\t\"github.com/axyz/golaroid\"\n\t\"github.com/axyz/golaroid/cache\"\n\t\"github.com/axyz/golaroid/reader\"\n\t\"github.com/axyz/golaroid/transform\"\n\t\"github.com/axyz/golaroid/writer\"\n)\n\nfunc init() {\n\truntime.GOMAXPROCS(runtime.NumCPU())\n}\n\nfunc main() {\n\toptions := golaroid.Options{\n\t\tPort: 8080,\n\t\tReaders: golaroid.Readers{\n\t\t\t\"local\": reader.Local,\n\t\t},\n\t\tTransformers: golaroid.Transformers{\n\t\t\t\"resize\": transform.Resize,\n\t\t\t\"strip\":  transform.Strip,\n\t\t\t\"jpeg\":   transform.Jpeg,\n\t\t},\n\t\tWriters: golaroid.Writers{\n\t\t\t\"local\": writer.Local,\n\t\t},\n\t\tCaches: golaroid.Caches{\n\t\t\t\"local\": cache.Local,\n\t\t},\n\t}\n\n\tgolaroid.Run(options)\n}\n```\n\nexample config:\n```yaml\nentities:\n- Name: media\n  Route: \"/media/\"\n\n  InputReader:\n    name: local\n    options:\n      folder: \"./media\"\n\n  OutputWriters:\n  - name: local\n    options:\n      folder: \"./output\"\n\n  CachingLayer:\n    name: local\n    options:\n      folder: \"./cache\"\n\n  Variants:\n    thumb:\n      transformations:\n      - name: resize\n        options:\n          width: 200\n          height: 600\n          filter: lanczos\n          multistep: true\n      - name: strip\n      - name: jpeg\n        options:\n          quality: 85\n```\n\n## Modules\ngolaroid is extremely modular and custom `Readers`, `Writers`, \n`Caches` and `Transformers` for each entity can be defined and plugged as\nrequired.\n\nSome basic modules are provided with the golaroid package itself:\n- `golaroid.reader`\n  - `Local`: simple local file reader \n- `golaroid.writer`\n  - `Local`: simple local file writer\n- `golaroid.cache`\n  - `Local`: simple file based cache\n- `golaroid.transform`\n  - `Jpeg`: jpeg encoding using imageMagick\n  - `Resize`: resizing using imageMagick with multi-step support\n  - `Strip`: metadata removal for size reduction\n  \nWriting your own modules is also possible and simple as you only have to define\nfunctions operating on binary data.\n\n### Readers\nA `Reader` should have type\n```go\nfunc(variant string, path string, opts map[string]interface{}) ([]byte, error)\n```\nGiven the variant name, a path for the media item and arbitrary options should return\nthe binary data for the media item and an error object.\n\n### Writers\nA `Writer` should have type\n```go\nfunc(variant string, path string, data []byte, opts map[string]interface{}) error\n```\nGiven the variant name, a path for the media item, the media item itself as\nbinary data and arbitrary options should write somewhere the data by side effect\nand return an error object.\n\n### Caches\na `Cache` should be a `golaroid.Cache` struct that defines `Get` and a `Set`\nmethods.\n```go\ntype Cache struct {\n\tGet func(variant string, path string, opts map[string]interface{}) ([]byte, error)\n\tSet func(variant string, path string, data []byte, opts map[string]interface{}) error\n}\n```\n`Get` and `Set` methods should allow to save and retrieve binary data for the\nmedia items given the variant, the path and arbitrary options.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxyz%2Fgolaroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxyz%2Fgolaroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxyz%2Fgolaroid/lists"}