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