go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/auth_service/api/rpcpb/allowlists_grpc.pb.go (about) 1 // Copyright 2021 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/allowlists.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 emptypb "google.golang.org/protobuf/types/known/emptypb" 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 Allowlists_ListAllowlists_FullMethodName = "/auth.service.Allowlists/ListAllowlists" 38 Allowlists_GetAllowlist_FullMethodName = "/auth.service.Allowlists/GetAllowlist" 39 ) 40 41 // AllowlistsClient is the client API for Allowlists 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 AllowlistsClient interface { 45 // ListAllowlists returns all the allowlists currently stored in LUCI Auth 46 // service datastore. The allowlists will be returned in alphabetical order 47 // based on their ID. 48 ListAllowlists(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListAllowlistsResponse, error) 49 // GetAllowlist returns Allowlist information for a requested Allowlist. 50 GetAllowlist(ctx context.Context, in *GetAllowlistRequest, opts ...grpc.CallOption) (*Allowlist, error) 51 } 52 53 type allowlistsClient struct { 54 cc grpc.ClientConnInterface 55 } 56 57 func NewAllowlistsClient(cc grpc.ClientConnInterface) AllowlistsClient { 58 return &allowlistsClient{cc} 59 } 60 61 func (c *allowlistsClient) ListAllowlists(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListAllowlistsResponse, error) { 62 out := new(ListAllowlistsResponse) 63 err := c.cc.Invoke(ctx, Allowlists_ListAllowlists_FullMethodName, in, out, opts...) 64 if err != nil { 65 return nil, err 66 } 67 return out, nil 68 } 69 70 func (c *allowlistsClient) GetAllowlist(ctx context.Context, in *GetAllowlistRequest, opts ...grpc.CallOption) (*Allowlist, error) { 71 out := new(Allowlist) 72 err := c.cc.Invoke(ctx, Allowlists_GetAllowlist_FullMethodName, in, out, opts...) 73 if err != nil { 74 return nil, err 75 } 76 return out, nil 77 } 78 79 // AllowlistsServer is the server API for Allowlists service. 80 // All implementations must embed UnimplementedAllowlistsServer 81 // for forward compatibility 82 type AllowlistsServer interface { 83 // ListAllowlists returns all the allowlists currently stored in LUCI Auth 84 // service datastore. The allowlists will be returned in alphabetical order 85 // based on their ID. 86 ListAllowlists(context.Context, *emptypb.Empty) (*ListAllowlistsResponse, error) 87 // GetAllowlist returns Allowlist information for a requested Allowlist. 88 GetAllowlist(context.Context, *GetAllowlistRequest) (*Allowlist, error) 89 mustEmbedUnimplementedAllowlistsServer() 90 } 91 92 // UnimplementedAllowlistsServer must be embedded to have forward compatible implementations. 93 type UnimplementedAllowlistsServer struct { 94 } 95 96 func (UnimplementedAllowlistsServer) ListAllowlists(context.Context, *emptypb.Empty) (*ListAllowlistsResponse, error) { 97 return nil, status.Errorf(codes.Unimplemented, "method ListAllowlists not implemented") 98 } 99 func (UnimplementedAllowlistsServer) GetAllowlist(context.Context, *GetAllowlistRequest) (*Allowlist, error) { 100 return nil, status.Errorf(codes.Unimplemented, "method GetAllowlist not implemented") 101 } 102 func (UnimplementedAllowlistsServer) mustEmbedUnimplementedAllowlistsServer() {} 103 104 // UnsafeAllowlistsServer may be embedded to opt out of forward compatibility for this service. 105 // Use of this interface is not recommended, as added methods to AllowlistsServer will 106 // result in compilation errors. 107 type UnsafeAllowlistsServer interface { 108 mustEmbedUnimplementedAllowlistsServer() 109 } 110 111 func RegisterAllowlistsServer(s grpc.ServiceRegistrar, srv AllowlistsServer) { 112 s.RegisterService(&Allowlists_ServiceDesc, srv) 113 } 114 115 func _Allowlists_ListAllowlists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 116 in := new(emptypb.Empty) 117 if err := dec(in); err != nil { 118 return nil, err 119 } 120 if interceptor == nil { 121 return srv.(AllowlistsServer).ListAllowlists(ctx, in) 122 } 123 info := &grpc.UnaryServerInfo{ 124 Server: srv, 125 FullMethod: Allowlists_ListAllowlists_FullMethodName, 126 } 127 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 128 return srv.(AllowlistsServer).ListAllowlists(ctx, req.(*emptypb.Empty)) 129 } 130 return interceptor(ctx, in, info, handler) 131 } 132 133 func _Allowlists_GetAllowlist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 134 in := new(GetAllowlistRequest) 135 if err := dec(in); err != nil { 136 return nil, err 137 } 138 if interceptor == nil { 139 return srv.(AllowlistsServer).GetAllowlist(ctx, in) 140 } 141 info := &grpc.UnaryServerInfo{ 142 Server: srv, 143 FullMethod: Allowlists_GetAllowlist_FullMethodName, 144 } 145 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 146 return srv.(AllowlistsServer).GetAllowlist(ctx, req.(*GetAllowlistRequest)) 147 } 148 return interceptor(ctx, in, info, handler) 149 } 150 151 // Allowlists_ServiceDesc is the grpc.ServiceDesc for Allowlists service. 152 // It's only intended for direct use with grpc.RegisterService, 153 // and not to be introspected or modified (even as a copy) 154 var Allowlists_ServiceDesc = grpc.ServiceDesc{ 155 ServiceName: "auth.service.Allowlists", 156 HandlerType: (*AllowlistsServer)(nil), 157 Methods: []grpc.MethodDesc{ 158 { 159 MethodName: "ListAllowlists", 160 Handler: _Allowlists_ListAllowlists_Handler, 161 }, 162 { 163 MethodName: "GetAllowlist", 164 Handler: _Allowlists_GetAllowlist_Handler, 165 }, 166 }, 167 Streams: []grpc.StreamDesc{}, 168 Metadata: "go.chromium.org/luci/auth_service/api/rpcpb/allowlists.proto", 169 }