dangeroustech/StreamDL

View on GitHub
protos/stream_grpc.pb.go

Summary

Maintainability
A
0 mins
Test Coverage
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package streamdl

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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// StreamClient is the client API for Stream 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 StreamClient interface {
    GetStream(ctx context.Context, in *StreamInfo, opts ...grpc.CallOption) (*StreamResponse, error)
}

type streamClient struct {
    cc grpc.ClientConnInterface
}

func NewStreamClient(cc grpc.ClientConnInterface) StreamClient {
    return &streamClient{cc}
}

func (c *streamClient) GetStream(ctx context.Context, in *StreamInfo, opts ...grpc.CallOption) (*StreamResponse, error) {
    out := new(StreamResponse)
    err := c.cc.Invoke(ctx, "/protos.Stream/GetStream", in, out, opts...)
    if err != nil {
        return nil, err
    }
    return out, nil
}

// StreamServer is the server API for Stream service.
// All implementations must embed UnimplementedStreamServer
// for forward compatibility
type StreamServer interface {
    GetStream(context.Context, *StreamInfo) (*StreamResponse, error)
    mustEmbedUnimplementedStreamServer()
}

// UnimplementedStreamServer must be embedded to have forward compatible implementations.
type UnimplementedStreamServer struct {
}

func (UnimplementedStreamServer) GetStream(context.Context, *StreamInfo) (*StreamResponse, error) {
    return nil, status.Errorf(codes.Unimplemented, "method GetStream not implemented")
}
func (UnimplementedStreamServer) mustEmbedUnimplementedStreamServer() {}

// UnsafeStreamServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to StreamServer will
// result in compilation errors.
type UnsafeStreamServer interface {
    mustEmbedUnimplementedStreamServer()
}

func RegisterStreamServer(s grpc.ServiceRegistrar, srv StreamServer) {
    s.RegisterService(&Stream_ServiceDesc, srv)
}

func _Stream_GetStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(StreamInfo)
    if err := dec(in); err != nil {
        return nil, err
    }
    if interceptor == nil {
        return srv.(StreamServer).GetStream(ctx, in)
    }
    info := &grpc.UnaryServerInfo{
        Server:     srv,
        FullMethod: "/protos.Stream/GetStream",
    }
    handler := func(ctx context.Context, req interface{}) (interface{}, error) {
        return srv.(StreamServer).GetStream(ctx, req.(*StreamInfo))
    }
    return interceptor(ctx, in, info, handler)
}

// Stream_ServiceDesc is the grpc.ServiceDesc for Stream service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Stream_ServiceDesc = grpc.ServiceDesc{
    ServiceName: "protos.Stream",
    HandlerType: (*StreamServer)(nil),
    Methods: []grpc.MethodDesc{
        {
            MethodName: "GetStream",
            Handler:    _Stream_GetStream_Handler,
        },
    },
    Streams:  []grpc.StreamDesc{},
    Metadata: "protos/stream.proto",
}