GRPC Package Naming and Structure
masterThe FIT GRPC uses a specific package naming convention to ensure compatibility with Go and Java, and to support hierarchical levels (Cluster, Scope, Collection).
Naming Conventions:
- Flat Directory Structure: Used to allow performers to pull in all protobuf files easily.
- Filename Mapping: Filenames include the package name to replace a directory structure (e.g.,
sdk.kv.options.protobelongs to packageprotocol.sdk.kv). - Specificity Hierarchy: Package names follow a pattern where the right-most part identifies the broad component, and preceding parts add specificity. Example:
sdk.cluster.query.index_manageridentifies anIndexManagerthat is aQuerytype at theClusterlevel. - Shared Code: The
protocol.sharedpackage is reserved for code shared between the SDK and transactions. - Naming Style: Use
sdk.kv.Getrather thansdk.kv.SdkKvGet(Exception:transactions.TransactionResult).
Constraints:
- Avoid Import Cycles: Ensure protobuf imports do not create cycles that prevent Go compilation.
- Filename/Message Uniqueness: Do not name a
.protofile the same as an existing enum or message (e.g., ifPerformerCapsexists, do not name the fileperformer_caps.proto) to avoid Java compilation errors.