Skip to main content

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.

FieldTypeDescription
IDuint32Unique identifier for the feature (primary key)
NamestringName of the feature
DescriptionstringDescription of what the feature does
IsActiveboolIndicates if the feature is currently active
CreatedAttime.TimeTimestamp when the feature was created
UpdatedAttime.TimeTimestamp of the most recent update
CreatedByuint32User ID who created the feature
UpdatedByuint32User 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 via page_number and page_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.