Skip to content
Snippets Groups Projects
Commit c6e76379 authored by André Sterba's avatar André Sterba
Browse files

Provide Api Makefile

parent 59210224
No related branches found
No related tags found
1 merge request!253Migration in monorepo
Pipeline #97921 failed
This commit is part of merge request !253. Comments created here will be created in the context of that merge request.
build:
buf mod update proto
buf generate
//
// Copyright 2020 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc (unknown)
// source: github.com/openconfig/gnmi/proto/collector/collector.proto
package gnmi
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ReconnectRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Target []string `protobuf:"bytes,1,rep,name=target,proto3" json:"target,omitempty"` // List of targets to reconnect.
}
func (x *ReconnectRequest) Reset() {
*x = ReconnectRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_github_com_openconfig_gnmi_proto_collector_collector_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ReconnectRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReconnectRequest) ProtoMessage() {}
func (x *ReconnectRequest) ProtoReflect() protoreflect.Message {
mi := &file_github_com_openconfig_gnmi_proto_collector_collector_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ReconnectRequest.ProtoReflect.Descriptor instead.
func (*ReconnectRequest) Descriptor() ([]byte, []int) {
return file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDescGZIP(), []int{0}
}
func (x *ReconnectRequest) GetTarget() []string {
if x != nil {
return x.Target
}
return nil
}
type Nil struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Nil) Reset() {
*x = Nil{}
if protoimpl.UnsafeEnabled {
mi := &file_github_com_openconfig_gnmi_proto_collector_collector_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Nil) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Nil) ProtoMessage() {}
func (x *Nil) ProtoReflect() protoreflect.Message {
mi := &file_github_com_openconfig_gnmi_proto_collector_collector_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Nil.ProtoReflect.Descriptor instead.
func (*Nil) Descriptor() ([]byte, []int) {
return file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDescGZIP(), []int{1}
}
var File_github_com_openconfig_gnmi_proto_collector_collector_proto protoreflect.FileDescriptor
var file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDesc = []byte{
0x0a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6d, 0x69, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x6f, 0x6c,
0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x6e,
0x6d, 0x69, 0x22, 0x2a, 0x0a, 0x10, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x05,
0x0a, 0x03, 0x4e, 0x69, 0x6c, 0x32, 0x3d, 0x0a, 0x09, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x6f, 0x72, 0x12, 0x30, 0x0a, 0x09, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12,
0x16, 0x2e, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x09, 0x2e, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x4e,
0x69, 0x6c, 0x22, 0x00, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e,
0x6d, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x6f, 0x72, 0x3b, 0x67, 0x6e, 0x6d, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDescOnce sync.Once
file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDescData = file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDesc
)
func file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDescGZIP() []byte {
file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDescOnce.Do(func() {
file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDescData)
})
return file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDescData
}
var file_github_com_openconfig_gnmi_proto_collector_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_github_com_openconfig_gnmi_proto_collector_collector_proto_goTypes = []interface{}{
(*ReconnectRequest)(nil), // 0: gnmi.ReconnectRequest
(*Nil)(nil), // 1: gnmi.Nil
}
var file_github_com_openconfig_gnmi_proto_collector_collector_proto_depIdxs = []int32{
0, // 0: gnmi.Collector.Reconnect:input_type -> gnmi.ReconnectRequest
1, // 1: gnmi.Collector.Reconnect:output_type -> gnmi.Nil
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_github_com_openconfig_gnmi_proto_collector_collector_proto_init() }
func file_github_com_openconfig_gnmi_proto_collector_collector_proto_init() {
if File_github_com_openconfig_gnmi_proto_collector_collector_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_github_com_openconfig_gnmi_proto_collector_collector_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ReconnectRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_github_com_openconfig_gnmi_proto_collector_collector_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Nil); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_github_com_openconfig_gnmi_proto_collector_collector_proto_goTypes,
DependencyIndexes: file_github_com_openconfig_gnmi_proto_collector_collector_proto_depIdxs,
MessageInfos: file_github_com_openconfig_gnmi_proto_collector_collector_proto_msgTypes,
}.Build()
File_github_com_openconfig_gnmi_proto_collector_collector_proto = out.File
file_github_com_openconfig_gnmi_proto_collector_collector_proto_rawDesc = nil
file_github_com_openconfig_gnmi_proto_collector_collector_proto_goTypes = nil
file_github_com_openconfig_gnmi_proto_collector_collector_proto_depIdxs = nil
}
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package gnmi
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// CollectorClient is the client API for Collector service.
//
// 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.
type CollectorClient interface {
// Reconnect requests that the existing connections for one or more specified
// targets will be stopped and new connections established.
Reconnect(ctx context.Context, in *ReconnectRequest, opts ...grpc.CallOption) (*Nil, error)
}
type collectorClient struct {
cc grpc.ClientConnInterface
}
func NewCollectorClient(cc grpc.ClientConnInterface) CollectorClient {
return &collectorClient{cc}
}
func (c *collectorClient) Reconnect(ctx context.Context, in *ReconnectRequest, opts ...grpc.CallOption) (*Nil, error) {
out := new(Nil)
err := c.cc.Invoke(ctx, "/gnmi.Collector/Reconnect", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// CollectorServer is the server API for Collector service.
// All implementations must embed UnimplementedCollectorServer
// for forward compatibility
type CollectorServer interface {
// Reconnect requests that the existing connections for one or more specified
// targets will be stopped and new connections established.
Reconnect(context.Context, *ReconnectRequest) (*Nil, error)
mustEmbedUnimplementedCollectorServer()
}
// UnimplementedCollectorServer must be embedded to have forward compatible implementations.
type UnimplementedCollectorServer struct {
}
func (UnimplementedCollectorServer) Reconnect(context.Context, *ReconnectRequest) (*Nil, error) {
return nil, status.Errorf(codes.Unimplemented, "method Reconnect not implemented")
}
func (UnimplementedCollectorServer) mustEmbedUnimplementedCollectorServer() {}
// UnsafeCollectorServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CollectorServer will
// result in compilation errors.
type UnsafeCollectorServer interface {
mustEmbedUnimplementedCollectorServer()
}
func RegisterCollectorServer(s grpc.ServiceRegistrar, srv CollectorServer) {
s.RegisterService(&Collector_ServiceDesc, srv)
}
func _Collector_Reconnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReconnectRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CollectorServer).Reconnect(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gnmi.Collector/Reconnect",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CollectorServer).Reconnect(ctx, req.(*ReconnectRequest))
}
return interceptor(ctx, in, info, handler)
}
// Collector_ServiceDesc is the grpc.ServiceDesc for Collector service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Collector_ServiceDesc = grpc.ServiceDesc{
ServiceName: "gnmi.Collector",
HandlerType: (*CollectorServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Reconnect",
Handler: _Collector_Reconnect_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "github.com/openconfig/gnmi/proto/collector/collector.proto",
}
This diff is collapsed.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package gnmi
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// GNMIClient is the client API for GNMI service.
//
// 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.
type GNMIClient interface {
// Capabilities allows the client to retrieve the set of capabilities that
// is supported by the target. This allows the target to validate the
// service version that is implemented and retrieve the set of models that
// the target supports. The models can then be specified in subsequent RPCs
// to restrict the set of data that is utilized.
// Reference: gNMI Specification Section 3.2
Capabilities(ctx context.Context, in *CapabilityRequest, opts ...grpc.CallOption) (*CapabilityResponse, error)
// Retrieve a snapshot of data from the target. A Get RPC requests that the
// target snapshots a subset of the data tree as specified by the paths
// included in the message and serializes this to be returned to the
// client using the specified encoding.
// Reference: gNMI Specification Section 3.3
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
// Set allows the client to modify the state of data on the target. The
// paths to modified along with the new values that the client wishes
// to set the value to.
// Reference: gNMI Specification Section 3.4
Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error)
// Subscribe allows a client to request the target to send it values
// of particular paths within the data tree. These values may be streamed
// at a particular cadence (STREAM), sent one off on a long-lived channel
// (POLL), or sent as a one-off retrieval (ONCE).
// Reference: gNMI Specification Section 3.5
Subscribe(ctx context.Context, opts ...grpc.CallOption) (GNMI_SubscribeClient, error)
}
type gNMIClient struct {
cc grpc.ClientConnInterface
}
func NewGNMIClient(cc grpc.ClientConnInterface) GNMIClient {
return &gNMIClient{cc}
}
func (c *gNMIClient) Capabilities(ctx context.Context, in *CapabilityRequest, opts ...grpc.CallOption) (*CapabilityResponse, error) {
out := new(CapabilityResponse)
err := c.cc.Invoke(ctx, "/gnmi.gNMI/Capabilities", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *gNMIClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
out := new(GetResponse)
err := c.cc.Invoke(ctx, "/gnmi.gNMI/Get", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *gNMIClient) Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error) {
out := new(SetResponse)
err := c.cc.Invoke(ctx, "/gnmi.gNMI/Set", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *gNMIClient) Subscribe(ctx context.Context, opts ...grpc.CallOption) (GNMI_SubscribeClient, error) {
stream, err := c.cc.NewStream(ctx, &GNMI_ServiceDesc.Streams[0], "/gnmi.gNMI/Subscribe", opts...)
if err != nil {
return nil, err
}
x := &gNMISubscribeClient{stream}
return x, nil
}
type GNMI_SubscribeClient interface {
Send(*SubscribeRequest) error
Recv() (*SubscribeResponse, error)
grpc.ClientStream
}
type gNMISubscribeClient struct {
grpc.ClientStream
}
func (x *gNMISubscribeClient) Send(m *SubscribeRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *gNMISubscribeClient) Recv() (*SubscribeResponse, error) {
m := new(SubscribeResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// GNMIServer is the server API for GNMI service.
// All implementations must embed UnimplementedGNMIServer
// for forward compatibility
type GNMIServer interface {
// Capabilities allows the client to retrieve the set of capabilities that
// is supported by the target. This allows the target to validate the
// service version that is implemented and retrieve the set of models that
// the target supports. The models can then be specified in subsequent RPCs
// to restrict the set of data that is utilized.
// Reference: gNMI Specification Section 3.2
Capabilities(context.Context, *CapabilityRequest) (*CapabilityResponse, error)
// Retrieve a snapshot of data from the target. A Get RPC requests that the
// target snapshots a subset of the data tree as specified by the paths
// included in the message and serializes this to be returned to the
// client using the specified encoding.
// Reference: gNMI Specification Section 3.3
Get(context.Context, *GetRequest) (*GetResponse, error)
// Set allows the client to modify the state of data on the target. The
// paths to modified along with the new values that the client wishes
// to set the value to.
// Reference: gNMI Specification Section 3.4
Set(context.Context, *SetRequest) (*SetResponse, error)
// Subscribe allows a client to request the target to send it values
// of particular paths within the data tree. These values may be streamed
// at a particular cadence (STREAM), sent one off on a long-lived channel
// (POLL), or sent as a one-off retrieval (ONCE).
// Reference: gNMI Specification Section 3.5
Subscribe(GNMI_SubscribeServer) error
mustEmbedUnimplementedGNMIServer()
}
// UnimplementedGNMIServer must be embedded to have forward compatible implementations.
type UnimplementedGNMIServer struct {
}
func (UnimplementedGNMIServer) Capabilities(context.Context, *CapabilityRequest) (*CapabilityResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Capabilities not implemented")
}
func (UnimplementedGNMIServer) Get(context.Context, *GetRequest) (*GetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedGNMIServer) Set(context.Context, *SetRequest) (*SetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Set not implemented")
}
func (UnimplementedGNMIServer) Subscribe(GNMI_SubscribeServer) error {
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
}
func (UnimplementedGNMIServer) mustEmbedUnimplementedGNMIServer() {}
// UnsafeGNMIServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to GNMIServer will
// result in compilation errors.
type UnsafeGNMIServer interface {
mustEmbedUnimplementedGNMIServer()
}
func RegisterGNMIServer(s grpc.ServiceRegistrar, srv GNMIServer) {
s.RegisterService(&GNMI_ServiceDesc, srv)
}
func _GNMI_Capabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CapabilityRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GNMIServer).Capabilities(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gnmi.gNMI/Capabilities",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GNMIServer).Capabilities(ctx, req.(*CapabilityRequest))
}
return interceptor(ctx, in, info, handler)
}
func _GNMI_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GNMIServer).Get(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gnmi.gNMI/Get",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GNMIServer).Get(ctx, req.(*GetRequest))
}
return interceptor(ctx, in, info, handler)
}
func _GNMI_Set_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GNMIServer).Set(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gnmi.gNMI/Set",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GNMIServer).Set(ctx, req.(*SetRequest))
}
return interceptor(ctx, in, info, handler)
}
func _GNMI_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(GNMIServer).Subscribe(&gNMISubscribeServer{stream})
}
type GNMI_SubscribeServer interface {
Send(*SubscribeResponse) error
Recv() (*SubscribeRequest, error)
grpc.ServerStream
}
type gNMISubscribeServer struct {
grpc.ServerStream
}
func (x *gNMISubscribeServer) Send(m *SubscribeResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *gNMISubscribeServer) Recv() (*SubscribeRequest, error) {
m := new(SubscribeRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// GNMI_ServiceDesc is the grpc.ServiceDesc for GNMI service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var GNMI_ServiceDesc = grpc.ServiceDesc{
ServiceName: "gnmi.gNMI",
HandlerType: (*GNMIServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Capabilities",
Handler: _GNMI_Capabilities_Handler,
},
{
MethodName: "Get",
Handler: _GNMI_Get_Handler,
},
{
MethodName: "Set",
Handler: _GNMI_Set_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Subscribe",
Handler: _GNMI_Subscribe_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "github.com/openconfig/gnmi/proto/gnmi/gnmi.proto",
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package gnmi_fake
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// AgentManagerClient is the client API for AgentManager service.
//
// 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.
type AgentManagerClient interface {
// Add adds an agent to the server.
Add(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Config, error)
// Remove removes an agent from the server.
Remove(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Config, error)
// Status returns the current status of an agent on the server.
Status(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Config, error)
}
type agentManagerClient struct {
cc grpc.ClientConnInterface
}
func NewAgentManagerClient(cc grpc.ClientConnInterface) AgentManagerClient {
return &agentManagerClient{cc}
}
func (c *agentManagerClient) Add(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Config, error) {
out := new(Config)
err := c.cc.Invoke(ctx, "/gnmi.fake.AgentManager/Add", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentManagerClient) Remove(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Config, error) {
out := new(Config)
err := c.cc.Invoke(ctx, "/gnmi.fake.AgentManager/Remove", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentManagerClient) Status(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Config, error) {
out := new(Config)
err := c.cc.Invoke(ctx, "/gnmi.fake.AgentManager/Status", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AgentManagerServer is the server API for AgentManager service.
// All implementations must embed UnimplementedAgentManagerServer
// for forward compatibility
type AgentManagerServer interface {
// Add adds an agent to the server.
Add(context.Context, *Config) (*Config, error)
// Remove removes an agent from the server.
Remove(context.Context, *Config) (*Config, error)
// Status returns the current status of an agent on the server.
Status(context.Context, *Config) (*Config, error)
mustEmbedUnimplementedAgentManagerServer()
}
// UnimplementedAgentManagerServer must be embedded to have forward compatible implementations.
type UnimplementedAgentManagerServer struct {
}
func (UnimplementedAgentManagerServer) Add(context.Context, *Config) (*Config, error) {
return nil, status.Errorf(codes.Unimplemented, "method Add not implemented")
}
func (UnimplementedAgentManagerServer) Remove(context.Context, *Config) (*Config, error) {
return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented")
}
func (UnimplementedAgentManagerServer) Status(context.Context, *Config) (*Config, error) {
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
}
func (UnimplementedAgentManagerServer) mustEmbedUnimplementedAgentManagerServer() {}
// UnsafeAgentManagerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AgentManagerServer will
// result in compilation errors.
type UnsafeAgentManagerServer interface {
mustEmbedUnimplementedAgentManagerServer()
}
func RegisterAgentManagerServer(s grpc.ServiceRegistrar, srv AgentManagerServer) {
s.RegisterService(&AgentManager_ServiceDesc, srv)
}
func _AgentManager_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Config)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentManagerServer).Add(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gnmi.fake.AgentManager/Add",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentManagerServer).Add(ctx, req.(*Config))
}
return interceptor(ctx, in, info, handler)
}
func _AgentManager_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Config)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentManagerServer).Remove(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gnmi.fake.AgentManager/Remove",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentManagerServer).Remove(ctx, req.(*Config))
}
return interceptor(ctx, in, info, handler)
}
func _AgentManager_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Config)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentManagerServer).Status(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gnmi.fake.AgentManager/Status",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentManagerServer).Status(ctx, req.(*Config))
}
return interceptor(ctx, in, info, handler)
}
// AgentManager_ServiceDesc is the grpc.ServiceDesc for AgentManager service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AgentManager_ServiceDesc = grpc.ServiceDesc{
ServiceName: "gnmi.fake.AgentManager",
HandlerType: (*AgentManagerServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Add",
Handler: _AgentManager_Add_Handler,
},
{
MethodName: "Remove",
Handler: _AgentManager_Remove_Handler,
},
{
MethodName: "Status",
Handler: _AgentManager_Status_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "github.com/openconfig/gnmi/testing/fake/proto/fake.proto",
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment