Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add feature flag service to proto file #26

Merged
merged 2 commits into from
May 20, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions pb/demo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

syntax = "proto3";

import "google/protobuf/timestamp.proto";

package hipstershop;

option go_package = "genproto/hipstershop";
Expand Down Expand Up @@ -260,3 +262,58 @@ message Ad {
// short advertisement text to display.
string text = 2;
}

// ------------Feature flag service------------------

service FeatureFlagService {
rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {}
rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {}
rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {}
rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {}
rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {}
}

message Flag {
string name = 1;
string description = 2;
bool enabled = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp updated_at = 5;
}

message GetFlagRequest {
string name = 1;
}

message GetFlagResponse {
Flag flag = 1;
}

message CreateFlagRequest {
string name = 1;
string description = 2;
bool enabled = 3;
}

message CreateFlagResponse {
Flag flag = 1;
}

message UpdateFlagRequest {
string name = 1;
bool enabled = 2;
}

message UpdateFlagResponse {}

message ListFlagsRequest {}

message ListFlagsResponse {
repated Flag flag = 1;
}

message DeleteFlagRequest {
string name = 1;
}

message DeleteFlagResponse {}