Files
dozzle/proto/cloud/cloud_grpc.pb.go
Amir Raminfar 8dac197f60 feat(cloud-proto): add SearchLogs unary RPC (#4672)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 16:11:32 -07:00

165 lines
7.0 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.0
// - protoc v7.34.1
// source: cloud.proto
package cloud
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 (
CloudToolService_ToolStream_FullMethodName = "/cloud.CloudToolService/ToolStream"
CloudToolService_SearchLogs_FullMethodName = "/cloud.CloudToolService/SearchLogs"
)
// CloudToolServiceClient is the client API for CloudToolService 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.
type CloudToolServiceClient interface {
// Dozzle sends ToolResponse, cloud sends ToolRequest
ToolStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ToolResponse, ToolRequest], error)
// Dozzle-initiated unary call: search log lines this instance has streamed
// to Cloud (gated by streamLogs opt-in). Cloud scopes the query server-side
// to the (user_id, api_key_id) derived from the authenticated connection;
// Dozzle does NOT pass any identity fields in the request.
SearchLogs(ctx context.Context, in *SearchLogsRequest, opts ...grpc.CallOption) (*SearchLogsResponse, error)
}
type cloudToolServiceClient struct {
cc grpc.ClientConnInterface
}
func NewCloudToolServiceClient(cc grpc.ClientConnInterface) CloudToolServiceClient {
return &cloudToolServiceClient{cc}
}
func (c *cloudToolServiceClient) ToolStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ToolResponse, ToolRequest], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &CloudToolService_ServiceDesc.Streams[0], CloudToolService_ToolStream_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[ToolResponse, ToolRequest]{ClientStream: stream}
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 CloudToolService_ToolStreamClient = grpc.BidiStreamingClient[ToolResponse, ToolRequest]
func (c *cloudToolServiceClient) SearchLogs(ctx context.Context, in *SearchLogsRequest, opts ...grpc.CallOption) (*SearchLogsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SearchLogsResponse)
err := c.cc.Invoke(ctx, CloudToolService_SearchLogs_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// CloudToolServiceServer is the server API for CloudToolService service.
// All implementations must embed UnimplementedCloudToolServiceServer
// for forward compatibility.
type CloudToolServiceServer interface {
// Dozzle sends ToolResponse, cloud sends ToolRequest
ToolStream(grpc.BidiStreamingServer[ToolResponse, ToolRequest]) error
// Dozzle-initiated unary call: search log lines this instance has streamed
// to Cloud (gated by streamLogs opt-in). Cloud scopes the query server-side
// to the (user_id, api_key_id) derived from the authenticated connection;
// Dozzle does NOT pass any identity fields in the request.
SearchLogs(context.Context, *SearchLogsRequest) (*SearchLogsResponse, error)
mustEmbedUnimplementedCloudToolServiceServer()
}
// UnimplementedCloudToolServiceServer 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 UnimplementedCloudToolServiceServer struct{}
func (UnimplementedCloudToolServiceServer) ToolStream(grpc.BidiStreamingServer[ToolResponse, ToolRequest]) error {
return status.Error(codes.Unimplemented, "method ToolStream not implemented")
}
func (UnimplementedCloudToolServiceServer) SearchLogs(context.Context, *SearchLogsRequest) (*SearchLogsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method SearchLogs not implemented")
}
func (UnimplementedCloudToolServiceServer) mustEmbedUnimplementedCloudToolServiceServer() {}
func (UnimplementedCloudToolServiceServer) testEmbeddedByValue() {}
// UnsafeCloudToolServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CloudToolServiceServer will
// result in compilation errors.
type UnsafeCloudToolServiceServer interface {
mustEmbedUnimplementedCloudToolServiceServer()
}
func RegisterCloudToolServiceServer(s grpc.ServiceRegistrar, srv CloudToolServiceServer) {
// If the following call panics, it indicates UnimplementedCloudToolServiceServer 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(&CloudToolService_ServiceDesc, srv)
}
func _CloudToolService_ToolStream_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(CloudToolServiceServer).ToolStream(&grpc.GenericServerStream[ToolResponse, ToolRequest]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type CloudToolService_ToolStreamServer = grpc.BidiStreamingServer[ToolResponse, ToolRequest]
func _CloudToolService_SearchLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchLogsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CloudToolServiceServer).SearchLogs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CloudToolService_SearchLogs_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CloudToolServiceServer).SearchLogs(ctx, req.(*SearchLogsRequest))
}
return interceptor(ctx, in, info, handler)
}
// CloudToolService_ServiceDesc is the grpc.ServiceDesc for CloudToolService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CloudToolService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "cloud.CloudToolService",
HandlerType: (*CloudToolServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SearchLogs",
Handler: _CloudToolService_SearchLogs_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "ToolStream",
Handler: _CloudToolService_ToolStream_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "cloud.proto",
}