Feature Microservice
The Feature microservice manages application features, including creation, activation, deactivation, and listing. It supports pagination and includes audit metadata for traceability.
Model (feature.go)β
Featureβ
Defines the schema for a feature in the application.
| Field | Type | Description |
|---|---|---|
ID | uint32 | Unique identifier for the feature (primary key) |
Name | string | Name of the feature |
Description | string | Description of what the feature does |
IsActive | bool | Indicates if the feature is currently active |
CreatedAt | time.Time | Timestamp when the feature was created |
UpdatedAt | time.Time | Timestamp of the most recent update |
CreatedBy | uint32 | User ID who created the feature |
UpdatedBy | uint32 | User ID who last updated the feature |
gRPC API (feature.proto)β
This defines the gRPC service used to manage features.
Messagesβ
Feature: Reflects the data model.FeatureResponse: Returns a list of features along with metadata like total count.CheckResponse: Indicates the result of activation/deactivation.CreateFeatureRequest: Request to create a new feature.UpdateFeatureByIDRequest: Request to update an existing feature by ID.ActivateFeatureByIDRequest,DeactivateFeatureByIDRequest: Used to toggle a featureβs active state.GetFeatureByIdRequest: Fetch a single feature by ID.ListAllFeaturesRequest: Supports pagination viapage_numberandpage_size.
Servicesβ
CreateFeature(CreateFeatureRequest) returns (FeatureResponse)UpdateFeatureByID(UpdateFeatureByIDRequest) returns (FeatureResponse)ActivateFeatureByID(ActivateFeatureByIDRequest) returns (CheckResponse)DeactivateFeatureByID(DeactivateFeatureByIDRequest) returns (CheckResponse)ListAllFeatures(ListAllFeaturesRequest) returns (FeatureResponse)GetFeatureByID(GetFeatureByIdRequest) returns (FeatureResponse)
These RPCs enable complete lifecycle management of feature flags or modules in the application.