github.com/yoheimuta/protolint@v0.49.8-0.20240515023657-4ecaebb7575d/internal/addon/plugin/shared/gRPCClient.go (about) 1 package shared 2 3 import ( 4 "context" 5 6 "github.com/yoheimuta/protolint/internal/addon/plugin/proto" 7 ) 8 9 // GRPCClient is the implementation of RuleSet. 10 type GRPCClient struct { 11 client proto.RuleSetServiceClient 12 } 13 14 // ListRules returns all supported rules metadata. 15 func (c *GRPCClient) ListRules(req *proto.ListRulesRequest) (*proto.ListRulesResponse, error) { 16 return c.client.ListRules(context.Background(), req) 17 } 18 19 // Apply applies the rule to the proto. 20 func (c *GRPCClient) Apply(req *proto.ApplyRequest) (*proto.ApplyResponse, error) { 21 return c.client.Apply(context.Background(), req) 22 }