240 lines
9.4 KiB
Go
240 lines
9.4 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.1
|
|
// - protoc v3.21.12
|
|
// source: logtail.proto
|
|
|
|
package logtailpb
|
|
|
|
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 (
|
|
LogtailService_TopN_FullMethodName = "/logtail.LogtailService/TopN"
|
|
LogtailService_Trend_FullMethodName = "/logtail.LogtailService/Trend"
|
|
LogtailService_StreamSnapshots_FullMethodName = "/logtail.LogtailService/StreamSnapshots"
|
|
LogtailService_ListTargets_FullMethodName = "/logtail.LogtailService/ListTargets"
|
|
)
|
|
|
|
// LogtailServiceClient is the client API for LogtailService 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 LogtailServiceClient interface {
|
|
TopN(ctx context.Context, in *TopNRequest, opts ...grpc.CallOption) (*TopNResponse, error)
|
|
Trend(ctx context.Context, in *TrendRequest, opts ...grpc.CallOption) (*TrendResponse, error)
|
|
StreamSnapshots(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Snapshot], error)
|
|
ListTargets(ctx context.Context, in *ListTargetsRequest, opts ...grpc.CallOption) (*ListTargetsResponse, error)
|
|
}
|
|
|
|
type logtailServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewLogtailServiceClient(cc grpc.ClientConnInterface) LogtailServiceClient {
|
|
return &logtailServiceClient{cc}
|
|
}
|
|
|
|
func (c *logtailServiceClient) TopN(ctx context.Context, in *TopNRequest, opts ...grpc.CallOption) (*TopNResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(TopNResponse)
|
|
err := c.cc.Invoke(ctx, LogtailService_TopN_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *logtailServiceClient) Trend(ctx context.Context, in *TrendRequest, opts ...grpc.CallOption) (*TrendResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(TrendResponse)
|
|
err := c.cc.Invoke(ctx, LogtailService_Trend_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *logtailServiceClient) StreamSnapshots(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Snapshot], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &LogtailService_ServiceDesc.Streams[0], LogtailService_StreamSnapshots_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[SnapshotRequest, Snapshot]{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 LogtailService_StreamSnapshotsClient = grpc.ServerStreamingClient[Snapshot]
|
|
|
|
func (c *logtailServiceClient) ListTargets(ctx context.Context, in *ListTargetsRequest, opts ...grpc.CallOption) (*ListTargetsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListTargetsResponse)
|
|
err := c.cc.Invoke(ctx, LogtailService_ListTargets_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// LogtailServiceServer is the server API for LogtailService service.
|
|
// All implementations must embed UnimplementedLogtailServiceServer
|
|
// for forward compatibility.
|
|
type LogtailServiceServer interface {
|
|
TopN(context.Context, *TopNRequest) (*TopNResponse, error)
|
|
Trend(context.Context, *TrendRequest) (*TrendResponse, error)
|
|
StreamSnapshots(*SnapshotRequest, grpc.ServerStreamingServer[Snapshot]) error
|
|
ListTargets(context.Context, *ListTargetsRequest) (*ListTargetsResponse, error)
|
|
mustEmbedUnimplementedLogtailServiceServer()
|
|
}
|
|
|
|
// UnimplementedLogtailServiceServer 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 UnimplementedLogtailServiceServer struct{}
|
|
|
|
func (UnimplementedLogtailServiceServer) TopN(context.Context, *TopNRequest) (*TopNResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method TopN not implemented")
|
|
}
|
|
func (UnimplementedLogtailServiceServer) Trend(context.Context, *TrendRequest) (*TrendResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method Trend not implemented")
|
|
}
|
|
func (UnimplementedLogtailServiceServer) StreamSnapshots(*SnapshotRequest, grpc.ServerStreamingServer[Snapshot]) error {
|
|
return status.Error(codes.Unimplemented, "method StreamSnapshots not implemented")
|
|
}
|
|
func (UnimplementedLogtailServiceServer) ListTargets(context.Context, *ListTargetsRequest) (*ListTargetsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ListTargets not implemented")
|
|
}
|
|
func (UnimplementedLogtailServiceServer) mustEmbedUnimplementedLogtailServiceServer() {}
|
|
func (UnimplementedLogtailServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeLogtailServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to LogtailServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeLogtailServiceServer interface {
|
|
mustEmbedUnimplementedLogtailServiceServer()
|
|
}
|
|
|
|
func RegisterLogtailServiceServer(s grpc.ServiceRegistrar, srv LogtailServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedLogtailServiceServer 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(&LogtailService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _LogtailService_TopN_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(TopNRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LogtailServiceServer).TopN(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LogtailService_TopN_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LogtailServiceServer).TopN(ctx, req.(*TopNRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LogtailService_Trend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(TrendRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LogtailServiceServer).Trend(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LogtailService_Trend_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LogtailServiceServer).Trend(ctx, req.(*TrendRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LogtailService_StreamSnapshots_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(SnapshotRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(LogtailServiceServer).StreamSnapshots(m, &grpc.GenericServerStream[SnapshotRequest, Snapshot]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type LogtailService_StreamSnapshotsServer = grpc.ServerStreamingServer[Snapshot]
|
|
|
|
func _LogtailService_ListTargets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListTargetsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LogtailServiceServer).ListTargets(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LogtailService_ListTargets_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LogtailServiceServer).ListTargets(ctx, req.(*ListTargetsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// LogtailService_ServiceDesc is the grpc.ServiceDesc for LogtailService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var LogtailService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "logtail.LogtailService",
|
|
HandlerType: (*LogtailServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "TopN",
|
|
Handler: _LogtailService_TopN_Handler,
|
|
},
|
|
{
|
|
MethodName: "Trend",
|
|
Handler: _LogtailService_Trend_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListTargets",
|
|
Handler: _LogtailService_ListTargets_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "StreamSnapshots",
|
|
Handler: _LogtailService_StreamSnapshots_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "logtail.proto",
|
|
}
|