go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/auth_service/api/rpcpb/accounts_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/accounts.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 Accounts_GetSelf_FullMethodName = "/auth.service.Accounts/GetSelf" 38 ) 39 40 // AccountsClient is the client API for Accounts 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 AccountsClient interface { 44 // GetSelf returns information about the caller based on passed 45 // authentication tokens. 46 // 47 // Also returns the caller's IP address (as seen by the service). Useful when 48 // debugging authentication issues. 49 GetSelf(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SelfInfo, error) 50 } 51 52 type accountsClient struct { 53 cc grpc.ClientConnInterface 54 } 55 56 func NewAccountsClient(cc grpc.ClientConnInterface) AccountsClient { 57 return &accountsClient{cc} 58 } 59 60 func (c *accountsClient) GetSelf(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SelfInfo, error) { 61 out := new(SelfInfo) 62 err := c.cc.Invoke(ctx, Accounts_GetSelf_FullMethodName, in, out, opts...) 63 if err != nil { 64 return nil, err 65 } 66 return out, nil 67 } 68 69 // AccountsServer is the server API for Accounts service. 70 // All implementations must embed UnimplementedAccountsServer 71 // for forward compatibility 72 type AccountsServer interface { 73 // GetSelf returns information about the caller based on passed 74 // authentication tokens. 75 // 76 // Also returns the caller's IP address (as seen by the service). Useful when 77 // debugging authentication issues. 78 GetSelf(context.Context, *emptypb.Empty) (*SelfInfo, error) 79 mustEmbedUnimplementedAccountsServer() 80 } 81 82 // UnimplementedAccountsServer must be embedded to have forward compatible implementations. 83 type UnimplementedAccountsServer struct { 84 } 85 86 func (UnimplementedAccountsServer) GetSelf(context.Context, *emptypb.Empty) (*SelfInfo, error) { 87 return nil, status.Errorf(codes.Unimplemented, "method GetSelf not implemented") 88 } 89 func (UnimplementedAccountsServer) mustEmbedUnimplementedAccountsServer() {} 90 91 // UnsafeAccountsServer may be embedded to opt out of forward compatibility for this service. 92 // Use of this interface is not recommended, as added methods to AccountsServer will 93 // result in compilation errors. 94 type UnsafeAccountsServer interface { 95 mustEmbedUnimplementedAccountsServer() 96 } 97 98 func RegisterAccountsServer(s grpc.ServiceRegistrar, srv AccountsServer) { 99 s.RegisterService(&Accounts_ServiceDesc, srv) 100 } 101 102 func _Accounts_GetSelf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 103 in := new(emptypb.Empty) 104 if err := dec(in); err != nil { 105 return nil, err 106 } 107 if interceptor == nil { 108 return srv.(AccountsServer).GetSelf(ctx, in) 109 } 110 info := &grpc.UnaryServerInfo{ 111 Server: srv, 112 FullMethod: Accounts_GetSelf_FullMethodName, 113 } 114 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 115 return srv.(AccountsServer).GetSelf(ctx, req.(*emptypb.Empty)) 116 } 117 return interceptor(ctx, in, info, handler) 118 } 119 120 // Accounts_ServiceDesc is the grpc.ServiceDesc for Accounts service. 121 // It's only intended for direct use with grpc.RegisterService, 122 // and not to be introspected or modified (even as a copy) 123 var Accounts_ServiceDesc = grpc.ServiceDesc{ 124 ServiceName: "auth.service.Accounts", 125 HandlerType: (*AccountsServer)(nil), 126 Methods: []grpc.MethodDesc{ 127 { 128 MethodName: "GetSelf", 129 Handler: _Accounts_GetSelf_Handler, 130 }, 131 }, 132 Streams: []grpc.StreamDesc{}, 133 Metadata: "go.chromium.org/luci/auth_service/api/rpcpb/accounts.proto", 134 }