go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/auth_service/api/rpcpb/authdb_grpc.pb.go (about) 1 // Copyright 2022 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/auth_service/api/rpcpb/authdb.proto 20 21 package rpcpb 22 23 import ( 24 context "context" 25 grpc "google.golang.org/grpc" 26 codes "google.golang.org/grpc/codes" 27 status "google.golang.org/grpc/status" 28 ) 29 30 // This is a compile-time assertion to ensure that this generated file 31 // is compatible with the grpc package it is being compiled against. 32 // Requires gRPC-Go v1.32.0 or later. 33 const _ = grpc.SupportPackageIsVersion7 34 35 const ( 36 AuthDB_GetSnapshot_FullMethodName = "/auth.service.AuthDB/GetSnapshot" 37 ) 38 39 // AuthDBClient is the client API for AuthDB service. 40 // 41 // 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. 42 type AuthDBClient interface { 43 // GetSnapshot serves the deflated AuthDB proto 44 // message with snapshot of all groups. 45 GetSnapshot(ctx context.Context, in *GetSnapshotRequest, opts ...grpc.CallOption) (*Snapshot, error) 46 } 47 48 type authDBClient struct { 49 cc grpc.ClientConnInterface 50 } 51 52 func NewAuthDBClient(cc grpc.ClientConnInterface) AuthDBClient { 53 return &authDBClient{cc} 54 } 55 56 func (c *authDBClient) GetSnapshot(ctx context.Context, in *GetSnapshotRequest, opts ...grpc.CallOption) (*Snapshot, error) { 57 out := new(Snapshot) 58 err := c.cc.Invoke(ctx, AuthDB_GetSnapshot_FullMethodName, in, out, opts...) 59 if err != nil { 60 return nil, err 61 } 62 return out, nil 63 } 64 65 // AuthDBServer is the server API for AuthDB service. 66 // All implementations must embed UnimplementedAuthDBServer 67 // for forward compatibility 68 type AuthDBServer interface { 69 // GetSnapshot serves the deflated AuthDB proto 70 // message with snapshot of all groups. 71 GetSnapshot(context.Context, *GetSnapshotRequest) (*Snapshot, error) 72 mustEmbedUnimplementedAuthDBServer() 73 } 74 75 // UnimplementedAuthDBServer must be embedded to have forward compatible implementations. 76 type UnimplementedAuthDBServer struct { 77 } 78 79 func (UnimplementedAuthDBServer) GetSnapshot(context.Context, *GetSnapshotRequest) (*Snapshot, error) { 80 return nil, status.Errorf(codes.Unimplemented, "method GetSnapshot not implemented") 81 } 82 func (UnimplementedAuthDBServer) mustEmbedUnimplementedAuthDBServer() {} 83 84 // UnsafeAuthDBServer may be embedded to opt out of forward compatibility for this service. 85 // Use of this interface is not recommended, as added methods to AuthDBServer will 86 // result in compilation errors. 87 type UnsafeAuthDBServer interface { 88 mustEmbedUnimplementedAuthDBServer() 89 } 90 91 func RegisterAuthDBServer(s grpc.ServiceRegistrar, srv AuthDBServer) { 92 s.RegisterService(&AuthDB_ServiceDesc, srv) 93 } 94 95 func _AuthDB_GetSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 96 in := new(GetSnapshotRequest) 97 if err := dec(in); err != nil { 98 return nil, err 99 } 100 if interceptor == nil { 101 return srv.(AuthDBServer).GetSnapshot(ctx, in) 102 } 103 info := &grpc.UnaryServerInfo{ 104 Server: srv, 105 FullMethod: AuthDB_GetSnapshot_FullMethodName, 106 } 107 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 108 return srv.(AuthDBServer).GetSnapshot(ctx, req.(*GetSnapshotRequest)) 109 } 110 return interceptor(ctx, in, info, handler) 111 } 112 113 // AuthDB_ServiceDesc is the grpc.ServiceDesc for AuthDB service. 114 // It's only intended for direct use with grpc.RegisterService, 115 // and not to be introspected or modified (even as a copy) 116 var AuthDB_ServiceDesc = grpc.ServiceDesc{ 117 ServiceName: "auth.service.AuthDB", 118 HandlerType: (*AuthDBServer)(nil), 119 Methods: []grpc.MethodDesc{ 120 { 121 MethodName: "GetSnapshot", 122 Handler: _AuthDB_GetSnapshot_Handler, 123 }, 124 }, 125 Streams: []grpc.StreamDesc{}, 126 Metadata: "go.chromium.org/luci/auth_service/api/rpcpb/authdb.proto", 127 }