This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# With function types instead of interfaces all ports are automatically fine-grained | |
type ForSelectingDecks func(command SelectDeckCommand) error | |
type ForUnselectingDecks func(command UnselectDeckCommand) error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
game | |
├── hexagon | |
│ ├── deckselection | |
│ │ ├── integration_test.go # primary adapter | |
│ │ ├── select_deck_command_handler.go # primary port + hexagon impl. | |
│ │ ├── select_deck_command_handler_test.go # primary adapter (unit test) | |
│ │ ├── select_deck.go # aggregate logic | |
│ │ ├── select_deck_http_handler.go # primary adapter | |
│ │ ├── select_deck_test.go # unit test | |
│ │ ├── unselect_deck_command_handler.go # primary port + hexagon impl. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
game | |
├── application | |
│ ├── card_play_command_handler.go # hexagon impl. | |
│ ├── deck_selection_command_handler.go # hexagon impl. | |
│ ├── for_enrolling_players.go # primary port | |
│ ├── for_playing_cards.go # primary port | |
│ ├── for_reading_active_players_projections.go # secondary port | |
│ ├── for_reading_deck_sets.go # secondary port | |
│ ├── for_selecting_decks.go # primary port | |
│ ├── for_storing_events.go # secondary port |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
game | |
├── application | |
│ ├── deck_builder_command_handler.go # hexagon implementation | |
│ ├── for_building_deck_sets.go # primary port | |
│ ├── for_playing_the_game.go # primary port | |
│ ├── for_reading_active_players_projections.go # secondary port | |
│ ├── for_reading_deck_sets.go # secondary port | |
│ ├── for_storing_deck_sets.go # secondary port | |
│ ├── for_storing_events.go # secondary port | |
│ └── player_command_handler.go # hexagon implementation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### the coarse-grained version ##### | |
type ForStoringEvents interface { | |
CreateEventStream(streamID lib.StreamID, event lib.Event) error | |
AppendEventsToStream( | |
streamID lib.StreamID, | |
expectedRevision uint64, | |
recordedEvents ...lib.Event, | |
) error | |
ReadEventStream(streamID lib.StreamID) (lib.EventStream, error) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### the coarse-grained version ##### | |
type ForPlayingTheGame interface { | |
SelectDeck(command SelectDeckCommand) error | |
UnselectDeck(command UnselectDeckCommand) error | |
EnrollPlayer(command EnrollPlayerCommand) error | |
SignOutPlayer(command SignOutPlayerCommand) error | |
PurgeInactivePlayers(command PurgeInactivePlayersCommand) (count uint, err error) | |
FinishCard(command FinishCardCommand) error | |
RejectCard(command RejectCardCommand) error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ForCreatingEventStreams interface { | |
Create(streamID lib.StreamID, event lib.Event) error | |
} | |
type ForAppendingEventsToStreams interface { | |
Append( | |
streamID lib.StreamID, | |
expectedRevision uint64, | |
recordedEvents ...lib.Event, | |
) error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
game | |
├── application | |
│ ├── commands.go # all commands | |
│ ├── commands_test.go # unit tests | |
│ ├── deck_selection_command_handler.go # driver port implementation | |
│ ├── deck_selection_command_handler_test.go # driver adapter | |
│ ├── driven_ports.go # all driven port definitions | |
│ ├── driver_ports.go # all driver port definitions | |
| └── # other use cases and more files skipped | |
├── domain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
game | |
├── application | |
│ ├── deckselection | |
│ │ ├── commands.go # all commands | |
│ │ ├── commands_test.go # unit tests | |
│ │ ├── integration_test.go # driver adapter | |
│ │ ├── command_handler.go # driver port definition and implementation | |
│ │ ├── command_handler_test.go # driver adapter | |
│ │ ├── http_handler.go # driver adapter | |
│ │ ├── select_deck.go # domain logic |
NewerOlder