Files
go-trustlog/api/grpc/pb/operation_grpc.pb.go
ryan d313449c5c refactor: 重构trustlog-sdk目录结构到trustlog/go-trustlog
- 将所有trustlog-sdk文件移动到trustlog/go-trustlog/目录
- 更新README中所有import路径从trustlog-sdk改为go-trustlog
- 更新cookiecutter配置文件中的项目名称
- 更新根目录.lefthook.yml以引用新位置的配置
- 添加go.sum文件到版本控制
- 删除过时的示例文件

这次重构与trustlog-server保持一致的目录结构,
为未来支持多语言SDK(Python、Java等)预留空间。
2025-12-22 13:37:57 +08:00

173 lines
7.5 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.21.12
// source: operation.proto
package pb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
OperationValidationService_ValidateOperation_FullMethodName = "/operation.OperationValidationService/ValidateOperation"
OperationValidationService_ListOperations_FullMethodName = "/operation.OperationValidationService/ListOperations"
)
// OperationValidationServiceClient is the client API for OperationValidationService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// ======================== gRPC 服务定义 ========================
type OperationValidationServiceClient interface {
// 单个请求,服务端流式返回进度与最终结果
ValidateOperation(ctx context.Context, in *ValidationReq, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ValidationStreamRes], error)
// 分页查询操作记录
ListOperations(ctx context.Context, in *ListOperationReq, opts ...grpc.CallOption) (*ListOperationRes, error)
}
type operationValidationServiceClient struct {
cc grpc.ClientConnInterface
}
func NewOperationValidationServiceClient(cc grpc.ClientConnInterface) OperationValidationServiceClient {
return &operationValidationServiceClient{cc}
}
func (c *operationValidationServiceClient) ValidateOperation(ctx context.Context, in *ValidationReq, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ValidationStreamRes], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &OperationValidationService_ServiceDesc.Streams[0], OperationValidationService_ValidateOperation_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[ValidationReq, ValidationStreamRes]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type OperationValidationService_ValidateOperationClient = grpc.ServerStreamingClient[ValidationStreamRes]
func (c *operationValidationServiceClient) ListOperations(ctx context.Context, in *ListOperationReq, opts ...grpc.CallOption) (*ListOperationRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListOperationRes)
err := c.cc.Invoke(ctx, OperationValidationService_ListOperations_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// OperationValidationServiceServer is the server API for OperationValidationService service.
// All implementations must embed UnimplementedOperationValidationServiceServer
// for forward compatibility.
//
// ======================== gRPC 服务定义 ========================
type OperationValidationServiceServer interface {
// 单个请求,服务端流式返回进度与最终结果
ValidateOperation(*ValidationReq, grpc.ServerStreamingServer[ValidationStreamRes]) error
// 分页查询操作记录
ListOperations(context.Context, *ListOperationReq) (*ListOperationRes, error)
mustEmbedUnimplementedOperationValidationServiceServer()
}
// UnimplementedOperationValidationServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedOperationValidationServiceServer struct{}
func (UnimplementedOperationValidationServiceServer) ValidateOperation(*ValidationReq, grpc.ServerStreamingServer[ValidationStreamRes]) error {
return status.Errorf(codes.Unimplemented, "method ValidateOperation not implemented")
}
func (UnimplementedOperationValidationServiceServer) ListOperations(context.Context, *ListOperationReq) (*ListOperationRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListOperations not implemented")
}
func (UnimplementedOperationValidationServiceServer) mustEmbedUnimplementedOperationValidationServiceServer() {
}
func (UnimplementedOperationValidationServiceServer) testEmbeddedByValue() {}
// UnsafeOperationValidationServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to OperationValidationServiceServer will
// result in compilation errors.
type UnsafeOperationValidationServiceServer interface {
mustEmbedUnimplementedOperationValidationServiceServer()
}
func RegisterOperationValidationServiceServer(s grpc.ServiceRegistrar, srv OperationValidationServiceServer) {
// If the following call pancis, it indicates UnimplementedOperationValidationServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&OperationValidationService_ServiceDesc, srv)
}
func _OperationValidationService_ValidateOperation_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(ValidationReq)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(OperationValidationServiceServer).ValidateOperation(m, &grpc.GenericServerStream[ValidationReq, ValidationStreamRes]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type OperationValidationService_ValidateOperationServer = grpc.ServerStreamingServer[ValidationStreamRes]
func _OperationValidationService_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListOperationReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OperationValidationServiceServer).ListOperations(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OperationValidationService_ListOperations_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OperationValidationServiceServer).ListOperations(ctx, req.(*ListOperationReq))
}
return interceptor(ctx, in, info, handler)
}
// OperationValidationService_ServiceDesc is the grpc.ServiceDesc for OperationValidationService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var OperationValidationService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "operation.OperationValidationService",
HandlerType: (*OperationValidationServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListOperations",
Handler: _OperationValidationService_ListOperations_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "ValidateOperation",
Handler: _OperationValidationService_ValidateOperation_Handler,
ServerStreams: true,
},
},
Metadata: "operation.proto",
}