How quickfixgo/quickfix works
Below are guidelines tailored to this project:
Main Components
• Core FIX Engine: Representing the heart of the library, this includes components such as session management (files like session.go, in_session.go, session_state.go, session_rejects.go), connection handling (connection.go, dialer.go, initiator.go, acceptor.go), and message processing (message.go, parser.go, message_router.go).
• Code Generator: The “cmd/generate-fix” directory encapsulates the tool responsible for generating code from FIX specification XML files (located in the “spec” directory) into type-safe messages, fields, and groups.
• Data Dictionary & Specifications: Show a module for the FIX specifications (spec/ folder) and the datadictionary package that builds and validates FIX message definitions.
• Persistence & Stores: Include persistence options such as on-disk file stores, in-memory stores, SQL and MongoDB stores (store/ directory and related tests), which handle session state and message persistence.
• Logging and Error Handling: Highlight the multiple logging options provided (log/file, log/screen, log/mongo, log/sql) alongside error management components.
• Utilities and Internal Services: Capture internal packages like “internal/event” and “internal/time_range” which support timing and event processing required for session management.
• Testing and Configuration: Although these may not be part of the runtime system, include a note for the presence of comprehensive unit tests, acceptance tests (see _test/), devcontainer configurations, and various configuration files (config/).
Relationships and Interactions
• Code Generation: Use a separate block to indicate that the “generate-fix” tool converts specification definitions (XML in spec/) into generated code that feeds into the core FIX engine.
• Logging: Connect logging components to key operations in session management, connection handling, and message processing to illustrate real-time tracking of FIX communications.
• Error Handling: Indicate that errors reported by message parsing or session issues get processed through the error management components.
Architectural Patterns and Technologies
• Spec-Driven Design: Emphasize that message definitions and validations are generated from formal FIX XML specifications.
• Pluggability: The separation of logging (file, screen, mongo, SQL) and store implementations (file, memory, SQL, Mongo) shows a clear use of the strategy pattern where developers can plug in different persistence or logging strategies.
• Language and Environment: Note that the project is written in Go, utilizes Docker for development (via .devcontainer), and integrates CI/CD pipelines through GitHub workflows.