Debian Codegraph @

pubsub/loadtest/pb/loadtest_grpc.pb.go

raw
1 // Copyright 2024 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
16 // versions:
17 // - protoc-gen-go-grpc v1.3.0
18 // - protoc v4.25.3
19 // source: loadtest.proto
20
21 package google_pubsub_loadtest
22
23 import (
24 context "context"
25
26 grpc "google.golang.org/grpc"
27 codes "google.golang.org/grpc/codes"
28 status "google.golang.org/grpc/status"
29 )
30
31 // This is a compile-time assertion to ensure that this generated file
32 // is compatible with the grpc package it is being compiled against.
33 // Requires gRPC-Go v1.32.0 or later.
34 const _ = grpc.SupportPackageIsVersion7
35
36 const (
37 LoadtestWorker_Start_FullMethodName = "/google.pubsub.loadtest.LoadtestWorker/Start"
38 LoadtestWorker_Check_FullMethodName = "/google.pubsub.loadtest.LoadtestWorker/Check"
39 )
40
41 // LoadtestWorkerClient is the client API for LoadtestWorker service.
42 //
43 // 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.
44 type LoadtestWorkerClient interface {
45 // Starts a worker
46 Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error)
47 // Check the status of a load test worker.
48 Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
49 }
50
51 type loadtestWorkerClient struct {
52 cc grpc.ClientConnInterface
53 }
54
55 func NewLoadtestWorkerClient(cc grpc.ClientConnInterface) LoadtestWorkerClient {
56 return &loadtestWorkerClient{cc}
57 }
58
59 func (c *loadtestWorkerClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) {
60 out := new(StartResponse)
61 err := c.cc.Invoke(ctx, LoadtestWorker_Start_FullMethodName, in, out, opts...)
62 if err != nil {
63 return nil, err
64 }
65 return out, nil
66 }
67
68 func (c *loadtestWorkerClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) {
69 out := new(CheckResponse)
70 err := c.cc.Invoke(ctx, LoadtestWorker_Check_FullMethodName, in, out, opts...)
71 if err != nil {
72 return nil, err
73 }
74 return out, nil
75 }
76
77 // LoadtestWorkerServer is the server API for LoadtestWorker service.
78 // All implementations must embed UnimplementedLoadtestWorkerServer
79 // for forward compatibility
80 type LoadtestWorkerServer interface {
81 // Starts a worker
82 Start(context.Context, *StartRequest) (*StartResponse, error)
83 // Check the status of a load test worker.
84 Check(context.Context, *CheckRequest) (*CheckResponse, error)
85 mustEmbedUnimplementedLoadtestWorkerServer()
86 }
87
88 // UnimplementedLoadtestWorkerServer must be embedded to have forward compatible implementations.
89 type UnimplementedLoadtestWorkerServer struct {
90 }
91
92 func (UnimplementedLoadtestWorkerServer) Start(context.Context, *StartRequest) (*StartResponse, error) {
93 return nil, status.Errorf(codes.Unimplemented, "method Start not implemented")
94 }
95 func (UnimplementedLoadtestWorkerServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) {
96 return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
97 }
98 func (UnimplementedLoadtestWorkerServer) mustEmbedUnimplementedLoadtestWorkerServer() {}
99
100 // UnsafeLoadtestWorkerServer may be embedded to opt out of forward compatibility for this service.
101 // Use of this interface is not recommended, as added methods to LoadtestWorkerServer will
102 // result in compilation errors.
103 type UnsafeLoadtestWorkerServer interface {
104 mustEmbedUnimplementedLoadtestWorkerServer()
105 }
106
107 func RegisterLoadtestWorkerServer(s grpc.ServiceRegistrar, srv LoadtestWorkerServer) {
108 s.RegisterService(&LoadtestWorker_ServiceDesc, srv)
109 }
110
111 func _LoadtestWorker_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
112 in := new(StartRequest)
113 if err := dec(in); err != nil {
114 return nil, err
115 }
116 if interceptor == nil {
117 return srv.(LoadtestWorkerServer).Start(ctx, in)
118 }
119 info := &grpc.UnaryServerInfo{
120 Server: srv,
121 FullMethod: LoadtestWorker_Start_FullMethodName,
122 }
123 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
124 return srv.(LoadtestWorkerServer).Start(ctx, req.(*StartRequest))
125 }
126 return interceptor(ctx, in, info, handler)
127 }
128
129 func _LoadtestWorker_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
130 in := new(CheckRequest)
131 if err := dec(in); err != nil {
132 return nil, err
133 }
134 if interceptor == nil {
135 return srv.(LoadtestWorkerServer).Check(ctx, in)
136 }
137 info := &grpc.UnaryServerInfo{
138 Server: srv,
139 FullMethod: LoadtestWorker_Check_FullMethodName,
140 }
141 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
142 return srv.(LoadtestWorkerServer).Check(ctx, req.(*CheckRequest))
143 }
144 return interceptor(ctx, in, info, handler)
145 }
146
147 // LoadtestWorker_ServiceDesc is the grpc.ServiceDesc for LoadtestWorker service.
148 // It's only intended for direct use with grpc.RegisterService,
149 // and not to be introspected or modified (even as a copy)
150 var LoadtestWorker_ServiceDesc = grpc.ServiceDesc{
151 ServiceName: "google.pubsub.loadtest.LoadtestWorker",
152 HandlerType: (*LoadtestWorkerServer)(nil),
153 Methods: []grpc.MethodDesc{
154 {
155 MethodName: "Start",
156 Handler: _LoadtestWorker_Start_Handler,
157 },
158 {
159 MethodName: "Check",
160 Handler: _LoadtestWorker_Check_Handler,
161 },
162 },
163 Streams: []grpc.StreamDesc{},
164 Metadata: "loadtest.proto",
165 }