Skip to content

Port service - take 1 - #1

Open
evt wants to merge 6 commits into
mainfrom
v0.1
Open

Port service - take 1#1
evt wants to merge 6 commits into
mainfrom
v0.1

Conversation

@evt

@evt evt commented Jun 3, 2023

Copy link
Copy Markdown
Owner

The service is split into ui, application, adapter and domain layers.
I had to rename ports layer to ui as it's easy to confuse sea ports with ports in hexagonal architecture.

Application layer includes commands and queries.

Commands available:

  • create or update port

Queries available:

  • get port by id
  • count ports

In order to parse large JSON files with limited RAM - application runs JSON decoder in the stream mode.

Storage is implemented as a simple in-memory map with sync.RWMutex. I could also use sync.Map as it better scales
in this scenario but I decided to keep it simple.

@evt evt self-assigned this Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant