Debian Codegraph @

envoy/service/auth/v2/external_auth_grpc.pb.go

raw
1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2 // versions:
3 // - protoc-gen-go-grpc v1.3.0
4 // - protoc v5.29.1
5 // source: envoy/service/auth/v2/external_auth.proto
6
7 package authv2
8
9 import (
10 context "context"
11 grpc "google.golang.org/grpc"
12 codes "google.golang.org/grpc/codes"
13 status "google.golang.org/grpc/status"
14 )
15
16 // This is a compile-time assertion to ensure that this generated file
17 // is compatible with the grpc package it is being compiled against.
18 // Requires gRPC-Go v1.32.0 or later.
19 const _ = grpc.SupportPackageIsVersion7
20
21 const (
22 Authorization_Check_FullMethodName = "/envoy.service.auth.v2.Authorization/Check"
23 )
24
25 // AuthorizationClient is the client API for Authorization service.
26 //
27 // 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.
28 type AuthorizationClient interface {
29 // Performs authorization check based on the attributes associated with the
30 // incoming request, and returns status `OK` or not `OK`.
31 Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
32 }
33
34 type authorizationClient struct {
35 cc grpc.ClientConnInterface
36 }
37
38 func NewAuthorizationClient(cc grpc.ClientConnInterface) AuthorizationClient {
39 return &authorizationClient{cc}
40 }
41
42 func (c *authorizationClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) {
43 out := new(CheckResponse)
44 err := c.cc.Invoke(ctx, Authorization_Check_FullMethodName, in, out, opts...)
45 if err != nil {
46 return nil, err
47 }
48 return out, nil
49 }
50
51 // AuthorizationServer is the server API for Authorization service.
52 // All implementations should embed UnimplementedAuthorizationServer
53 // for forward compatibility
54 type AuthorizationServer interface {
55 // Performs authorization check based on the attributes associated with the
56 // incoming request, and returns status `OK` or not `OK`.
57 Check(context.Context, *CheckRequest) (*CheckResponse, error)
58 }
59
60 // UnimplementedAuthorizationServer should be embedded to have forward compatible implementations.
61 type UnimplementedAuthorizationServer struct {
62 }
63
64 func (UnimplementedAuthorizationServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) {
65 return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
66 }
67
68 // UnsafeAuthorizationServer may be embedded to opt out of forward compatibility for this service.
69 // Use of this interface is not recommended, as added methods to AuthorizationServer will
70 // result in compilation errors.
71 type UnsafeAuthorizationServer interface {
72 mustEmbedUnimplementedAuthorizationServer()
73 }
74
75 func RegisterAuthorizationServer(s grpc.ServiceRegistrar, srv AuthorizationServer) {
76 s.RegisterService(&Authorization_ServiceDesc, srv)
77 }
78
79 func _Authorization_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
80 in := new(CheckRequest)
81 if err := dec(in); err != nil {
82 return nil, err
83 }
84 if interceptor == nil {
85 return srv.(AuthorizationServer).Check(ctx, in)
86 }
87 info := &grpc.UnaryServerInfo{
88 Server: srv,
89 FullMethod: Authorization_Check_FullMethodName,
90 }
91 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
92 return srv.(AuthorizationServer).Check(ctx, req.(*CheckRequest))
93 }
94 return interceptor(ctx, in, info, handler)
95 }
96
97 // Authorization_ServiceDesc is the grpc.ServiceDesc for Authorization service.
98 // It's only intended for direct use with grpc.RegisterService,
99 // and not to be introspected or modified (even as a copy)
100 var Authorization_ServiceDesc = grpc.ServiceDesc{
101 ServiceName: "envoy.service.auth.v2.Authorization",
102 HandlerType: (*AuthorizationServer)(nil),
103 Methods: []grpc.MethodDesc{
104 {
105 MethodName: "Check",
106 Handler: _Authorization_Check_Handler,
107 },
108 },
109 Streams: []grpc.StreamDesc{},
110 Metadata: "envoy/service/auth/v2/external_auth.proto",
111 }