Add buf lint/breaking targets and fix proto naming violations
- Add buf.yaml with STANDARD lint rules and FILE-level breaking change detection - Add proto-lint Makefile target (buf lint + buf breaking --against master) - Add lint Makefile target (golangci-lint) and include it in all - Fix proto target: use module= option so protoc writes to gen/ not proto/ - engine.proto: rename rpc Request→Execute and message types accordingly - acme.proto: drop redundant ACME prefix from SetConfig/ListAccounts/ListOrders messages - policy.proto: add CreatePolicyResponse/GetPolicyResponse wrappers instead of returning PolicyRule directly from multiple RPCs - Update grpcserver and webserver/client.go to match renamed types Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v3.20.3
|
||||
// source: metacrypt/v1/engine.proto
|
||||
// source: proto/metacrypt/v1/engine.proto
|
||||
|
||||
package metacryptv1
|
||||
|
||||
@@ -22,7 +22,7 @@ const (
|
||||
EngineService_Mount_FullMethodName = "/metacrypt.v1.EngineService/Mount"
|
||||
EngineService_Unmount_FullMethodName = "/metacrypt.v1.EngineService/Unmount"
|
||||
EngineService_ListMounts_FullMethodName = "/metacrypt.v1.EngineService/ListMounts"
|
||||
EngineService_Request_FullMethodName = "/metacrypt.v1.EngineService/Request"
|
||||
EngineService_Execute_FullMethodName = "/metacrypt.v1.EngineService/Execute"
|
||||
)
|
||||
|
||||
// EngineServiceClient is the client API for EngineService service.
|
||||
@@ -32,7 +32,7 @@ type EngineServiceClient interface {
|
||||
Mount(ctx context.Context, in *MountRequest, opts ...grpc.CallOption) (*MountResponse, error)
|
||||
Unmount(ctx context.Context, in *UnmountRequest, opts ...grpc.CallOption) (*UnmountResponse, error)
|
||||
ListMounts(ctx context.Context, in *ListMountsRequest, opts ...grpc.CallOption) (*ListMountsResponse, error)
|
||||
Request(ctx context.Context, in *EngineRequest, opts ...grpc.CallOption) (*EngineResponse, error)
|
||||
Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error)
|
||||
}
|
||||
|
||||
type engineServiceClient struct {
|
||||
@@ -73,10 +73,10 @@ func (c *engineServiceClient) ListMounts(ctx context.Context, in *ListMountsRequ
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *engineServiceClient) Request(ctx context.Context, in *EngineRequest, opts ...grpc.CallOption) (*EngineResponse, error) {
|
||||
func (c *engineServiceClient) Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(EngineResponse)
|
||||
err := c.cc.Invoke(ctx, EngineService_Request_FullMethodName, in, out, cOpts...)
|
||||
out := new(ExecuteResponse)
|
||||
err := c.cc.Invoke(ctx, EngineService_Execute_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -90,7 +90,7 @@ type EngineServiceServer interface {
|
||||
Mount(context.Context, *MountRequest) (*MountResponse, error)
|
||||
Unmount(context.Context, *UnmountRequest) (*UnmountResponse, error)
|
||||
ListMounts(context.Context, *ListMountsRequest) (*ListMountsResponse, error)
|
||||
Request(context.Context, *EngineRequest) (*EngineResponse, error)
|
||||
Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
|
||||
mustEmbedUnimplementedEngineServiceServer()
|
||||
}
|
||||
|
||||
@@ -110,8 +110,8 @@ func (UnimplementedEngineServiceServer) Unmount(context.Context, *UnmountRequest
|
||||
func (UnimplementedEngineServiceServer) ListMounts(context.Context, *ListMountsRequest) (*ListMountsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListMounts not implemented")
|
||||
}
|
||||
func (UnimplementedEngineServiceServer) Request(context.Context, *EngineRequest) (*EngineResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Request not implemented")
|
||||
func (UnimplementedEngineServiceServer) Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Execute not implemented")
|
||||
}
|
||||
func (UnimplementedEngineServiceServer) mustEmbedUnimplementedEngineServiceServer() {}
|
||||
func (UnimplementedEngineServiceServer) testEmbeddedByValue() {}
|
||||
@@ -188,20 +188,20 @@ func _EngineService_ListMounts_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _EngineService_Request_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EngineRequest)
|
||||
func _EngineService_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ExecuteRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(EngineServiceServer).Request(ctx, in)
|
||||
return srv.(EngineServiceServer).Execute(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: EngineService_Request_FullMethodName,
|
||||
FullMethod: EngineService_Execute_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(EngineServiceServer).Request(ctx, req.(*EngineRequest))
|
||||
return srv.(EngineServiceServer).Execute(ctx, req.(*ExecuteRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -226,10 +226,10 @@ var EngineService_ServiceDesc = grpc.ServiceDesc{
|
||||
Handler: _EngineService_ListMounts_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Request",
|
||||
Handler: _EngineService_Request_Handler,
|
||||
MethodName: "Execute",
|
||||
Handler: _EngineService_Execute_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "metacrypt/v1/engine.proto",
|
||||
Metadata: "proto/metacrypt/v1/engine.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user