Debian Codegraph @

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