| Abhay Kumar | 0371339 | 2025-12-30 05:20:58 +0000 | [diff] [blame^] | 1 | // Copyright 2018-2024 Open Networking Foundation (ONF) and the ONF Contributors |
| 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.6.0 |
| 18 | // - protoc v4.25.8 |
| 19 | // source: voltha_protos/extensions.proto |
| 20 | |
| 21 | package extension |
| 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.64.0 or later. |
| 33 | const _ = grpc.SupportPackageIsVersion9 |
| 34 | |
| 35 | const ( |
| 36 | Extension_GetExtValue_FullMethodName = "/extension.Extension/GetExtValue" |
| 37 | Extension_SetExtValue_FullMethodName = "/extension.Extension/SetExtValue" |
| 38 | ) |
| 39 | |
| 40 | // ExtensionClient is the client API for Extension 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 | // |
| 44 | // Extension is a service to get and set specific attributes |
| 45 | type ExtensionClient interface { |
| 46 | // Get a single attribute |
| 47 | GetExtValue(ctx context.Context, in *SingleGetValueRequest, opts ...grpc.CallOption) (*SingleGetValueResponse, error) |
| 48 | // Set a single attribute |
| 49 | SetExtValue(ctx context.Context, in *SingleSetValueRequest, opts ...grpc.CallOption) (*SingleSetValueResponse, error) |
| 50 | } |
| 51 | |
| 52 | type extensionClient struct { |
| 53 | cc grpc.ClientConnInterface |
| 54 | } |
| 55 | |
| 56 | func NewExtensionClient(cc grpc.ClientConnInterface) ExtensionClient { |
| 57 | return &extensionClient{cc} |
| 58 | } |
| 59 | |
| 60 | func (c *extensionClient) GetExtValue(ctx context.Context, in *SingleGetValueRequest, opts ...grpc.CallOption) (*SingleGetValueResponse, error) { |
| 61 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 62 | out := new(SingleGetValueResponse) |
| 63 | err := c.cc.Invoke(ctx, Extension_GetExtValue_FullMethodName, in, out, cOpts...) |
| 64 | if err != nil { |
| 65 | return nil, err |
| 66 | } |
| 67 | return out, nil |
| 68 | } |
| 69 | |
| 70 | func (c *extensionClient) SetExtValue(ctx context.Context, in *SingleSetValueRequest, opts ...grpc.CallOption) (*SingleSetValueResponse, error) { |
| 71 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 72 | out := new(SingleSetValueResponse) |
| 73 | err := c.cc.Invoke(ctx, Extension_SetExtValue_FullMethodName, in, out, cOpts...) |
| 74 | if err != nil { |
| 75 | return nil, err |
| 76 | } |
| 77 | return out, nil |
| 78 | } |
| 79 | |
| 80 | // ExtensionServer is the server API for Extension service. |
| 81 | // All implementations must embed UnimplementedExtensionServer |
| 82 | // for forward compatibility. |
| 83 | // |
| 84 | // Extension is a service to get and set specific attributes |
| 85 | type ExtensionServer interface { |
| 86 | // Get a single attribute |
| 87 | GetExtValue(context.Context, *SingleGetValueRequest) (*SingleGetValueResponse, error) |
| 88 | // Set a single attribute |
| 89 | SetExtValue(context.Context, *SingleSetValueRequest) (*SingleSetValueResponse, error) |
| 90 | mustEmbedUnimplementedExtensionServer() |
| 91 | } |
| 92 | |
| 93 | // UnimplementedExtensionServer must be embedded to have |
| 94 | // forward compatible implementations. |
| 95 | // |
| 96 | // NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 97 | // pointer dereference when methods are called. |
| 98 | type UnimplementedExtensionServer struct{} |
| 99 | |
| 100 | func (UnimplementedExtensionServer) GetExtValue(context.Context, *SingleGetValueRequest) (*SingleGetValueResponse, error) { |
| 101 | return nil, status.Error(codes.Unimplemented, "method GetExtValue not implemented") |
| 102 | } |
| 103 | func (UnimplementedExtensionServer) SetExtValue(context.Context, *SingleSetValueRequest) (*SingleSetValueResponse, error) { |
| 104 | return nil, status.Error(codes.Unimplemented, "method SetExtValue not implemented") |
| 105 | } |
| 106 | func (UnimplementedExtensionServer) mustEmbedUnimplementedExtensionServer() {} |
| 107 | func (UnimplementedExtensionServer) testEmbeddedByValue() {} |
| 108 | |
| 109 | // UnsafeExtensionServer may be embedded to opt out of forward compatibility for this service. |
| 110 | // Use of this interface is not recommended, as added methods to ExtensionServer will |
| 111 | // result in compilation errors. |
| 112 | type UnsafeExtensionServer interface { |
| 113 | mustEmbedUnimplementedExtensionServer() |
| 114 | } |
| 115 | |
| 116 | func RegisterExtensionServer(s grpc.ServiceRegistrar, srv ExtensionServer) { |
| 117 | // If the following call panics, it indicates UnimplementedExtensionServer was |
| 118 | // embedded by pointer and is nil. This will cause panics if an |
| 119 | // unimplemented method is ever invoked, so we test this at initialization |
| 120 | // time to prevent it from happening at runtime later due to I/O. |
| 121 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 122 | t.testEmbeddedByValue() |
| 123 | } |
| 124 | s.RegisterService(&Extension_ServiceDesc, srv) |
| 125 | } |
| 126 | |
| 127 | func _Extension_GetExtValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 128 | in := new(SingleGetValueRequest) |
| 129 | if err := dec(in); err != nil { |
| 130 | return nil, err |
| 131 | } |
| 132 | if interceptor == nil { |
| 133 | return srv.(ExtensionServer).GetExtValue(ctx, in) |
| 134 | } |
| 135 | info := &grpc.UnaryServerInfo{ |
| 136 | Server: srv, |
| 137 | FullMethod: Extension_GetExtValue_FullMethodName, |
| 138 | } |
| 139 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 140 | return srv.(ExtensionServer).GetExtValue(ctx, req.(*SingleGetValueRequest)) |
| 141 | } |
| 142 | return interceptor(ctx, in, info, handler) |
| 143 | } |
| 144 | |
| 145 | func _Extension_SetExtValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 146 | in := new(SingleSetValueRequest) |
| 147 | if err := dec(in); err != nil { |
| 148 | return nil, err |
| 149 | } |
| 150 | if interceptor == nil { |
| 151 | return srv.(ExtensionServer).SetExtValue(ctx, in) |
| 152 | } |
| 153 | info := &grpc.UnaryServerInfo{ |
| 154 | Server: srv, |
| 155 | FullMethod: Extension_SetExtValue_FullMethodName, |
| 156 | } |
| 157 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 158 | return srv.(ExtensionServer).SetExtValue(ctx, req.(*SingleSetValueRequest)) |
| 159 | } |
| 160 | return interceptor(ctx, in, info, handler) |
| 161 | } |
| 162 | |
| 163 | // Extension_ServiceDesc is the grpc.ServiceDesc for Extension service. |
| 164 | // It's only intended for direct use with grpc.RegisterService, |
| 165 | // and not to be introspected or modified (even as a copy) |
| 166 | var Extension_ServiceDesc = grpc.ServiceDesc{ |
| 167 | ServiceName: "extension.Extension", |
| 168 | HandlerType: (*ExtensionServer)(nil), |
| 169 | Methods: []grpc.MethodDesc{ |
| 170 | { |
| 171 | MethodName: "GetExtValue", |
| 172 | Handler: _Extension_GetExtValue_Handler, |
| 173 | }, |
| 174 | { |
| 175 | MethodName: "SetExtValue", |
| 176 | Handler: _Extension_SetExtValue_Handler, |
| 177 | }, |
| 178 | }, |
| 179 | Streams: []grpc.StreamDesc{}, |
| 180 | Metadata: "voltha_protos/extensions.proto", |
| 181 | } |