-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpusher_grpc.pb.go
More file actions
149 lines (127 loc) · 4.46 KB
/
pusher_grpc.pb.go
File metadata and controls
149 lines (127 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
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.
const _ = grpc.SupportPackageIsVersion7
// PusherClient is the client API for Pusher 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 PusherClient interface {
PusherEventBuff(ctx context.Context, opts ...grpc.CallOption) (Pusher_PusherEventBuffClient, error)
}
type pusherClient struct {
cc grpc.ClientConnInterface
}
func NewPusherClient(cc grpc.ClientConnInterface) PusherClient {
return &pusherClient{cc}
}
var pusherPusherEventBuffStreamDesc = &grpc.StreamDesc{
StreamName: "PusherEventBuff",
ServerStreams: true,
ClientStreams: true,
}
func (c *pusherClient) PusherEventBuff(ctx context.Context, opts ...grpc.CallOption) (Pusher_PusherEventBuffClient, error) {
stream, err := c.cc.NewStream(ctx, pusherPusherEventBuffStreamDesc, "/proto.Pusher/PusherEventBuff", opts...)
if err != nil {
return nil, err
}
x := &pusherPusherEventBuffClient{stream}
return x, nil
}
type Pusher_PusherEventBuffClient interface {
Send(*PusherEvent) error
Recv() (*PusherEvent, error)
grpc.ClientStream
}
type pusherPusherEventBuffClient struct {
grpc.ClientStream
}
func (x *pusherPusherEventBuffClient) Send(m *PusherEvent) error {
return x.ClientStream.SendMsg(m)
}
func (x *pusherPusherEventBuffClient) Recv() (*PusherEvent, error) {
m := new(PusherEvent)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// PusherService is the service API for Pusher service.
// Fields should be assigned to their respective handler implementations only before
// RegisterPusherService is called. Any unassigned fields will result in the
// handler for that method returning an Unimplemented error.
type PusherService struct {
PusherEventBuff func(Pusher_PusherEventBuffServer) error
}
func (s *PusherService) pusherEventBuff(_ interface{}, stream grpc.ServerStream) error {
return s.PusherEventBuff(&pusherPusherEventBuffServer{stream})
}
type Pusher_PusherEventBuffServer interface {
Send(*PusherEvent) error
Recv() (*PusherEvent, error)
grpc.ServerStream
}
type pusherPusherEventBuffServer struct {
grpc.ServerStream
}
func (x *pusherPusherEventBuffServer) Send(m *PusherEvent) error {
return x.ServerStream.SendMsg(m)
}
func (x *pusherPusherEventBuffServer) Recv() (*PusherEvent, error) {
m := new(PusherEvent)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// RegisterPusherService registers a service implementation with a gRPC server.
func RegisterPusherService(s grpc.ServiceRegistrar, srv *PusherService) {
srvCopy := *srv
if srvCopy.PusherEventBuff == nil {
srvCopy.PusherEventBuff = func(Pusher_PusherEventBuffServer) error {
return status.Errorf(codes.Unimplemented, "method PusherEventBuff not implemented")
}
}
sd := grpc.ServiceDesc{
ServiceName: "proto.Pusher",
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "PusherEventBuff",
Handler: srvCopy.pusherEventBuff,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "pusher.proto",
}
s.RegisterService(&sd, nil)
}
// NewPusherService creates a new PusherService containing the
// implemented methods of the Pusher service in s. Any unimplemented
// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
// This includes situations where the method handler is misspelled or has the wrong
// signature. For this reason, this function should be used with great care and
// is not recommended to be used by most users.
func NewPusherService(s interface{}) *PusherService {
ns := &PusherService{}
if h, ok := s.(interface {
PusherEventBuff(Pusher_PusherEventBuffServer) error
}); ok {
ns.PusherEventBuff = h.PusherEventBuff
}
return ns
}
// UnstablePusherService is the service API for Pusher service.
// New methods may be added to this interface if they are added to the service
// definition, which is not a backward-compatible change. For this reason,
// use of this type is not recommended.
type UnstablePusherService interface {
PusherEventBuff(Pusher_PusherEventBuffServer) error
}