Skip to content

Instantly share code, notes, and snippets.

@AntonStoeckl
Created June 3, 2022 07:35
Show Gist options
  • Save AntonStoeckl/7e9b2a040d5659610c2019f1d475feeb to your computer and use it in GitHub Desktop.
Save AntonStoeckl/7e9b2a040d5659610c2019f1d475feeb to your computer and use it in GitHub Desktop.
Example for Blog Post "Hexagonal Architecture: Structuring a project and the influence of granularity V2
game
├── hexagon
│ ├── forenrollingplayers
│ │ ├── command_handler.go # hexagon impl.
│ │ ├── command_handler_test.go # primary adapter (unit test)
│ │ ├── enroll_player.go # aggregate logic
│ │ ├── enroll_player_test.go # unit test
│ │ ├── http_handler.go # primary adapter
│ │ └── integration_test.go # primary adapter
│ ├── forfinishingcards
│ │ ├── command_handler.go # hexagon impl.
│ │ ├── command_handler_test.go # primary adapter (unit test)
│ │ ├── finish_card.go # aggregate logic
│ │ ├── finish_card_test.go # unit test
│ │ ├── http_handler.go # primary adapter
│ │ └── integration_test.go # primary adapter
│ ├── forpurginginactiveplayers
│ │ ├── command_handler.go # hexagon impl.
│ │ ├── command_handler_test.go # primary adapter (unit test)
│ │ ├── integration_test.go # primary adapter
│ │ └── scheduler.go # primary adapter
│ ├── forrejectingcards
│ │ ├── command_handler.go # hexagon impl.
│ │ ├── command_handler_test.go # primary adapter (unit test)
│ │ ├── http_handler.go # primary adapter
│ │ ├── integration_test.go # primary adapter
│ │ ├── reject_card.go # aggregate logic
│ │ └── reject_card_test.go # unit test
│ ├── forselectingdecks
│ │ ├── command_handler.go # hexagon impl.
│ │ ├── command_handler_test.go # primary adapter (unit test)
│ │ ├── http_handler.go # primary adapter
│ │ ├── integration_test.go # primary adapter
│ │ ├── select_deck.go # aggregate logic
│ │ └── select_deck_test.go # unit test
│ ├── forsigningoutplayers
│ │ ├── command_handler.go # hexagon impl.
│ │ ├── command_handler_test.go # primary adapter (unit test)
│ │ ├── http_handler.go # primary adapter
│ │ ├── integration_test.go # primary adapter
│ │ ├── sign_out_player.go # aggregate logic
│ │ └── sign_out_player_test.go # unit test
│ ├── forunselectingdecks
│ │ ├── command_handler.go # hexagon impl.
│ │ ├── command_handler_test.go # primary adapter (unit test)
│ │ ├── http_handler.go # primary adapter
│ │ ├── integration_test.go # primary adapter
│ │ ├── unselect_deck.go # aggregate logic
│ │ └── unselect_deck_test.go # unit test
│ ├── for_appending_events_to_streams.go # secondary port
│ ├── for_enrolling_players.go # primary port
│ ├── for_finishing_cards.go # primary port
│ ├── for_purging_inactive_players.go # primary port
│ ├── for_reading_active_players_projections.go # secondary port
│ ├── for_reading_deck_sets.go # secondary port
│ ├── for_reading_event_streams.go # secondary port
│ ├── for_rejecting_cards.go # primary port
│ ├── for_selecting_decks.go # primary port
│ ├── for_signing_out_players.go # primary port
│ └── for_unselecting_decks.go # primary port
└── infrastructure
├── esdb
│ ├── event_store.go # generic
│ └── player_event_store.go # secondary adapter
└── file
└── deck_set_reader.go # secondary adapter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment