go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/swarming/server/testing/integrationmocks/server_grpc.pb.go (about) 1 // Copyright 2023 The LUCI Authors. 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 v3.21.7 19 // source: go.chromium.org/luci/swarming/server/testing/integrationmocks/server.proto 20 21 package integrationmocks 22 23 import ( 24 context "context" 25 internals "go.chromium.org/luci/swarming/proto/internals" 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 IntegrationMocks_GeneratePollToken_FullMethodName = "/swarming.integrationmocks.IntegrationMocks/GeneratePollToken" 38 ) 39 40 // IntegrationMocksClient is the client API for IntegrationMocks service. 41 // 42 // 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. 43 type IntegrationMocksClient interface { 44 // GeneratePollToken produces a HMAC-tagged poll token. 45 GeneratePollToken(ctx context.Context, in *internals.PollState, opts ...grpc.CallOption) (*PollToken, error) 46 } 47 48 type integrationMocksClient struct { 49 cc grpc.ClientConnInterface 50 } 51 52 func NewIntegrationMocksClient(cc grpc.ClientConnInterface) IntegrationMocksClient { 53 return &integrationMocksClient{cc} 54 } 55 56 func (c *integrationMocksClient) GeneratePollToken(ctx context.Context, in *internals.PollState, opts ...grpc.CallOption) (*PollToken, error) { 57 out := new(PollToken) 58 err := c.cc.Invoke(ctx, IntegrationMocks_GeneratePollToken_FullMethodName, in, out, opts...) 59 if err != nil { 60 return nil, err 61 } 62 return out, nil 63 } 64 65 // IntegrationMocksServer is the server API for IntegrationMocks service. 66 // All implementations must embed UnimplementedIntegrationMocksServer 67 // for forward compatibility 68 type IntegrationMocksServer interface { 69 // GeneratePollToken produces a HMAC-tagged poll token. 70 GeneratePollToken(context.Context, *internals.PollState) (*PollToken, error) 71 mustEmbedUnimplementedIntegrationMocksServer() 72 } 73 74 // UnimplementedIntegrationMocksServer must be embedded to have forward compatible implementations. 75 type UnimplementedIntegrationMocksServer struct { 76 } 77 78 func (UnimplementedIntegrationMocksServer) GeneratePollToken(context.Context, *internals.PollState) (*PollToken, error) { 79 return nil, status.Errorf(codes.Unimplemented, "method GeneratePollToken not implemented") 80 } 81 func (UnimplementedIntegrationMocksServer) mustEmbedUnimplementedIntegrationMocksServer() {} 82 83 // UnsafeIntegrationMocksServer may be embedded to opt out of forward compatibility for this service. 84 // Use of this interface is not recommended, as added methods to IntegrationMocksServer will 85 // result in compilation errors. 86 type UnsafeIntegrationMocksServer interface { 87 mustEmbedUnimplementedIntegrationMocksServer() 88 } 89 90 func RegisterIntegrationMocksServer(s grpc.ServiceRegistrar, srv IntegrationMocksServer) { 91 s.RegisterService(&IntegrationMocks_ServiceDesc, srv) 92 } 93 94 func _IntegrationMocks_GeneratePollToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 95 in := new(internals.PollState) 96 if err := dec(in); err != nil { 97 return nil, err 98 } 99 if interceptor == nil { 100 return srv.(IntegrationMocksServer).GeneratePollToken(ctx, in) 101 } 102 info := &grpc.UnaryServerInfo{ 103 Server: srv, 104 FullMethod: IntegrationMocks_GeneratePollToken_FullMethodName, 105 } 106 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 107 return srv.(IntegrationMocksServer).GeneratePollToken(ctx, req.(*internals.PollState)) 108 } 109 return interceptor(ctx, in, info, handler) 110 } 111 112 // IntegrationMocks_ServiceDesc is the grpc.ServiceDesc for IntegrationMocks service. 113 // It's only intended for direct use with grpc.RegisterService, 114 // and not to be introspected or modified (even as a copy) 115 var IntegrationMocks_ServiceDesc = grpc.ServiceDesc{ 116 ServiceName: "swarming.integrationmocks.IntegrationMocks", 117 HandlerType: (*IntegrationMocksServer)(nil), 118 Methods: []grpc.MethodDesc{ 119 { 120 MethodName: "GeneratePollToken", 121 Handler: _IntegrationMocks_GeneratePollToken_Handler, 122 }, 123 }, 124 Streams: []grpc.StreamDesc{}, 125 Metadata: "go.chromium.org/luci/swarming/server/testing/integrationmocks/server.proto", 126 }