Files
2024-01-03 20:53:38 +08:00

106 lines
3.4 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.15.8
// source: observer.proto
package proto
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
// ObserverClient is the client API for Observer 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 ObserverClient interface {
Observe(ctx context.Context, in *ObserveRequest, opts ...grpc.CallOption) (*ObserveReply, error)
}
type observerClient struct {
cc grpc.ClientConnInterface
}
func NewObserverClient(cc grpc.ClientConnInterface) ObserverClient {
return &observerClient{cc}
}
func (c *observerClient) Observe(ctx context.Context, in *ObserveRequest, opts ...grpc.CallOption) (*ObserveReply, error) {
out := new(ObserveReply)
err := c.cc.Invoke(ctx, "/proto.Observer/Observe", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ObserverServer is the server API for Observer service.
// All implementations must embed UnimplementedObserverServer
// for forward compatibility
type ObserverServer interface {
Observe(context.Context, *ObserveRequest) (*ObserveReply, error)
mustEmbedUnimplementedObserverServer()
}
// UnimplementedObserverServer must be embedded to have forward compatible implementations.
type UnimplementedObserverServer struct {
}
func (UnimplementedObserverServer) Observe(context.Context, *ObserveRequest) (*ObserveReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Observe not implemented")
}
func (UnimplementedObserverServer) mustEmbedUnimplementedObserverServer() {}
// UnsafeObserverServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ObserverServer will
// result in compilation errors.
type UnsafeObserverServer interface {
mustEmbedUnimplementedObserverServer()
}
func RegisterObserverServer(s grpc.ServiceRegistrar, srv ObserverServer) {
s.RegisterService(&Observer_ServiceDesc, srv)
}
func _Observer_Observe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ObserveRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ObserverServer).Observe(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Observer/Observe",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ObserverServer).Observe(ctx, req.(*ObserveRequest))
}
return interceptor(ctx, in, info, handler)
}
// Observer_ServiceDesc is the grpc.ServiceDesc for Observer service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Observer_ServiceDesc = grpc.ServiceDesc{
ServiceName: "proto.Observer",
HandlerType: (*ObserverServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Observe",
Handler: _Observer_Observe_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "observer.proto",
}