{"id":15323723,"url":"https://github.com/mvrilo/port-svc","last_synced_at":"2025-04-05T15:14:16.802Z","repository":{"id":160347236,"uuid":"634220539","full_name":"mvrilo/port-svc","owner":"mvrilo","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-29T22:08:36.000Z","size":82,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T19:02:14.921Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvrilo.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}},"created_at":"2023-04-29T12:37:45.000Z","updated_at":"2023-05-02T20:06:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"e73ae110-0cfe-48ed-94ab-1b26f298ec86","html_url":"https://github.com/mvrilo/port-svc","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/mvrilo%2Fport-svc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvrilo%2Fport-svc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvrilo%2Fport-svc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvrilo%2Fport-svc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvrilo","download_url":"https://codeload.github.com/mvrilo/port-svc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353745,"owners_count":20925329,"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-10-01T09:21:25.909Z","updated_at":"2025-04-05T15:14:16.781Z","avatar_url":"https://github.com/mvrilo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# port-svc\n\nport-svc receives ports information as file and upserts it (insert or update) in a datastore. Current implementation is using an inmemory datastore backed by `map[string]domain.Port` (check [./domain](domain) for more domain definitions).\n\nIt also exposes a http server listening on a default port 8000. This server handles incoming requests for upserting ports:\n\n```\nPOST /ports\n```\n\nUsing curl for testing, sending data as json:\n\n```\ncurl -svf -X POST -d \"$(cat ports.json)\" http://localhost:8000/ports\n```\n\nUsing curl for testing, sending data as multipart upload:\n\n```\ncurl -vf -F \"uploadFile=@\\\"ports.json\\\"\" http://localhost:8000/ports\n```\n\n## Running\n\nUsing docker-compose:\n\n```\ndocker compose up port-svc\n```\n\n## Building\n\n`make build`\n\nor\n\n`go build -o port-svc ./cmd/port-svc/*.go`\n\n## Testing\n\n`make test`\n\nor\n\n`go test -race ./...`\n\n## Configuration\n\nEnvironment variables (and `.env` file) are supported.\n\nExample:\n\n```\nSERVER_ADDRESS=127.0.0.1:8000\n```\n\n## Architecture overview\n\n```\n.\n├── adapter        # adapter implementations\n│   └── inmemory   # in memory adapters\n├── cmd            # binary entrypoints\n│   └── port-svc   # main binary\n├── domain         # domain definitions\n├── port           # port implementations\n│   └── http       # http port (handlers) implementation\n└── usecase        # usecase implementations\n    └── portupsert # main implementation\n\n10 directories\n```\n\n## Next steps\n\n- Validation of the ports file json schema\n- Limit configuration for the ports file size\n- HTTP adapter: add logging, metrics and health check - (maybe move from net/http)\n- Add other data storages for actual persistence of the data\n- Github actions pipeline\n- Improve command-line ux: use cobra, config file, add help/version subcommand, etc\n- Documentation improvements: use openapi, add missing comments\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvrilo%2Fport-svc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvrilo%2Fport-svc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvrilo%2Fport-svc/lists"}