-
Notifications
You must be signed in to change notification settings - Fork 196
/
logging_grpc.pb.go
359 lines (327 loc) · 15 KB
/
logging_grpc.pb.go
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.12.4
// source: mockgcp/logging/v2/logging.proto
package loggingpb
import (
context "context"
empty "github.com/golang/protobuf/ptypes/empty"
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
// LoggingServiceV2Client is the client API for LoggingServiceV2 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 LoggingServiceV2Client interface {
// Deletes all the log entries in a log for the _Default Log Bucket. The log
// reappears if it receives new entries. Log entries written shortly before
// the delete operation might not be deleted. Entries received after the
// delete operation with a timestamp before the operation will be deleted.
DeleteLog(ctx context.Context, in *DeleteLogRequest, opts ...grpc.CallOption) (*empty.Empty, error)
// Writes log entries to Logging. This API method is the
// only way to send log entries to Logging. This method
// is used, directly or indirectly, by the Logging agent
// (fluentd) and all logging libraries configured to use Logging.
// A single request may contain log entries for a maximum of 1000
// different resources (projects, organizations, billing accounts or
// folders)
WriteLogEntries(ctx context.Context, in *WriteLogEntriesRequest, opts ...grpc.CallOption) (*WriteLogEntriesResponse, error)
// Lists log entries. Use this method to retrieve log entries that originated
// from a project/folder/organization/billing account. For ways to export log
// entries, see [Exporting
// Logs](https://cloud.google.com/logging/docs/export).
ListLogEntries(ctx context.Context, in *ListLogEntriesRequest, opts ...grpc.CallOption) (*ListLogEntriesResponse, error)
// Lists the descriptors for monitored resource types used by Logging.
ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error)
// Lists the logs in projects, organizations, folders, or billing accounts.
// Only logs that have entries are listed.
ListLogs(ctx context.Context, in *ListLogsRequest, opts ...grpc.CallOption) (*ListLogsResponse, error)
// Streaming read of log entries as they are ingested. Until the stream is
// terminated, it will continue reading logs.
TailLogEntries(ctx context.Context, opts ...grpc.CallOption) (LoggingServiceV2_TailLogEntriesClient, error)
}
type loggingServiceV2Client struct {
cc grpc.ClientConnInterface
}
func NewLoggingServiceV2Client(cc grpc.ClientConnInterface) LoggingServiceV2Client {
return &loggingServiceV2Client{cc}
}
func (c *loggingServiceV2Client) DeleteLog(ctx context.Context, in *DeleteLogRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/mockgcp.logging.v2.LoggingServiceV2/DeleteLog", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loggingServiceV2Client) WriteLogEntries(ctx context.Context, in *WriteLogEntriesRequest, opts ...grpc.CallOption) (*WriteLogEntriesResponse, error) {
out := new(WriteLogEntriesResponse)
err := c.cc.Invoke(ctx, "/mockgcp.logging.v2.LoggingServiceV2/WriteLogEntries", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loggingServiceV2Client) ListLogEntries(ctx context.Context, in *ListLogEntriesRequest, opts ...grpc.CallOption) (*ListLogEntriesResponse, error) {
out := new(ListLogEntriesResponse)
err := c.cc.Invoke(ctx, "/mockgcp.logging.v2.LoggingServiceV2/ListLogEntries", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loggingServiceV2Client) ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) {
out := new(ListMonitoredResourceDescriptorsResponse)
err := c.cc.Invoke(ctx, "/mockgcp.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loggingServiceV2Client) ListLogs(ctx context.Context, in *ListLogsRequest, opts ...grpc.CallOption) (*ListLogsResponse, error) {
out := new(ListLogsResponse)
err := c.cc.Invoke(ctx, "/mockgcp.logging.v2.LoggingServiceV2/ListLogs", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loggingServiceV2Client) TailLogEntries(ctx context.Context, opts ...grpc.CallOption) (LoggingServiceV2_TailLogEntriesClient, error) {
stream, err := c.cc.NewStream(ctx, &LoggingServiceV2_ServiceDesc.Streams[0], "/mockgcp.logging.v2.LoggingServiceV2/TailLogEntries", opts...)
if err != nil {
return nil, err
}
x := &loggingServiceV2TailLogEntriesClient{stream}
return x, nil
}
type LoggingServiceV2_TailLogEntriesClient interface {
Send(*TailLogEntriesRequest) error
Recv() (*TailLogEntriesResponse, error)
grpc.ClientStream
}
type loggingServiceV2TailLogEntriesClient struct {
grpc.ClientStream
}
func (x *loggingServiceV2TailLogEntriesClient) Send(m *TailLogEntriesRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *loggingServiceV2TailLogEntriesClient) Recv() (*TailLogEntriesResponse, error) {
m := new(TailLogEntriesResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// LoggingServiceV2Server is the server API for LoggingServiceV2 service.
// All implementations must embed UnimplementedLoggingServiceV2Server
// for forward compatibility
type LoggingServiceV2Server interface {
// Deletes all the log entries in a log for the _Default Log Bucket. The log
// reappears if it receives new entries. Log entries written shortly before
// the delete operation might not be deleted. Entries received after the
// delete operation with a timestamp before the operation will be deleted.
DeleteLog(context.Context, *DeleteLogRequest) (*empty.Empty, error)
// Writes log entries to Logging. This API method is the
// only way to send log entries to Logging. This method
// is used, directly or indirectly, by the Logging agent
// (fluentd) and all logging libraries configured to use Logging.
// A single request may contain log entries for a maximum of 1000
// different resources (projects, organizations, billing accounts or
// folders)
WriteLogEntries(context.Context, *WriteLogEntriesRequest) (*WriteLogEntriesResponse, error)
// Lists log entries. Use this method to retrieve log entries that originated
// from a project/folder/organization/billing account. For ways to export log
// entries, see [Exporting
// Logs](https://cloud.google.com/logging/docs/export).
ListLogEntries(context.Context, *ListLogEntriesRequest) (*ListLogEntriesResponse, error)
// Lists the descriptors for monitored resource types used by Logging.
ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error)
// Lists the logs in projects, organizations, folders, or billing accounts.
// Only logs that have entries are listed.
ListLogs(context.Context, *ListLogsRequest) (*ListLogsResponse, error)
// Streaming read of log entries as they are ingested. Until the stream is
// terminated, it will continue reading logs.
TailLogEntries(LoggingServiceV2_TailLogEntriesServer) error
mustEmbedUnimplementedLoggingServiceV2Server()
}
// UnimplementedLoggingServiceV2Server must be embedded to have forward compatible implementations.
type UnimplementedLoggingServiceV2Server struct {
}
func (UnimplementedLoggingServiceV2Server) DeleteLog(context.Context, *DeleteLogRequest) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteLog not implemented")
}
func (UnimplementedLoggingServiceV2Server) WriteLogEntries(context.Context, *WriteLogEntriesRequest) (*WriteLogEntriesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method WriteLogEntries not implemented")
}
func (UnimplementedLoggingServiceV2Server) ListLogEntries(context.Context, *ListLogEntriesRequest) (*ListLogEntriesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListLogEntries not implemented")
}
func (UnimplementedLoggingServiceV2Server) ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListMonitoredResourceDescriptors not implemented")
}
func (UnimplementedLoggingServiceV2Server) ListLogs(context.Context, *ListLogsRequest) (*ListLogsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListLogs not implemented")
}
func (UnimplementedLoggingServiceV2Server) TailLogEntries(LoggingServiceV2_TailLogEntriesServer) error {
return status.Errorf(codes.Unimplemented, "method TailLogEntries not implemented")
}
func (UnimplementedLoggingServiceV2Server) mustEmbedUnimplementedLoggingServiceV2Server() {}
// UnsafeLoggingServiceV2Server may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to LoggingServiceV2Server will
// result in compilation errors.
type UnsafeLoggingServiceV2Server interface {
mustEmbedUnimplementedLoggingServiceV2Server()
}
func RegisterLoggingServiceV2Server(s grpc.ServiceRegistrar, srv LoggingServiceV2Server) {
s.RegisterService(&LoggingServiceV2_ServiceDesc, srv)
}
func _LoggingServiceV2_DeleteLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteLogRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoggingServiceV2Server).DeleteLog(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/mockgcp.logging.v2.LoggingServiceV2/DeleteLog",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoggingServiceV2Server).DeleteLog(ctx, req.(*DeleteLogRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoggingServiceV2_WriteLogEntries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(WriteLogEntriesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoggingServiceV2Server).WriteLogEntries(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/mockgcp.logging.v2.LoggingServiceV2/WriteLogEntries",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoggingServiceV2Server).WriteLogEntries(ctx, req.(*WriteLogEntriesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoggingServiceV2_ListLogEntries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListLogEntriesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoggingServiceV2Server).ListLogEntries(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/mockgcp.logging.v2.LoggingServiceV2/ListLogEntries",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoggingServiceV2Server).ListLogEntries(ctx, req.(*ListLogEntriesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoggingServiceV2_ListMonitoredResourceDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListMonitoredResourceDescriptorsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoggingServiceV2Server).ListMonitoredResourceDescriptors(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/mockgcp.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoggingServiceV2Server).ListMonitoredResourceDescriptors(ctx, req.(*ListMonitoredResourceDescriptorsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoggingServiceV2_ListLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListLogsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoggingServiceV2Server).ListLogs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/mockgcp.logging.v2.LoggingServiceV2/ListLogs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoggingServiceV2Server).ListLogs(ctx, req.(*ListLogsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoggingServiceV2_TailLogEntries_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(LoggingServiceV2Server).TailLogEntries(&loggingServiceV2TailLogEntriesServer{stream})
}
type LoggingServiceV2_TailLogEntriesServer interface {
Send(*TailLogEntriesResponse) error
Recv() (*TailLogEntriesRequest, error)
grpc.ServerStream
}
type loggingServiceV2TailLogEntriesServer struct {
grpc.ServerStream
}
func (x *loggingServiceV2TailLogEntriesServer) Send(m *TailLogEntriesResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *loggingServiceV2TailLogEntriesServer) Recv() (*TailLogEntriesRequest, error) {
m := new(TailLogEntriesRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// LoggingServiceV2_ServiceDesc is the grpc.ServiceDesc for LoggingServiceV2 service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LoggingServiceV2_ServiceDesc = grpc.ServiceDesc{
ServiceName: "mockgcp.logging.v2.LoggingServiceV2",
HandlerType: (*LoggingServiceV2Server)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "DeleteLog",
Handler: _LoggingServiceV2_DeleteLog_Handler,
},
{
MethodName: "WriteLogEntries",
Handler: _LoggingServiceV2_WriteLogEntries_Handler,
},
{
MethodName: "ListLogEntries",
Handler: _LoggingServiceV2_ListLogEntries_Handler,
},
{
MethodName: "ListMonitoredResourceDescriptors",
Handler: _LoggingServiceV2_ListMonitoredResourceDescriptors_Handler,
},
{
MethodName: "ListLogs",
Handler: _LoggingServiceV2_ListLogs_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "TailLogEntries",
Handler: _LoggingServiceV2_TailLogEntries_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "mockgcp/logging/v2/logging.proto",
}