gnmireverse

package
v0.0.0-...-bd75d7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

README

The gNMIReverse gRPC service that reverses the direction of the dial for gNMI Subscriptions.

gNMI is a "dial-in" service. This means that a telemetry collector must make the connection to the gNMI target (such as an ethernet switch). This approach can cause issues in some deployments, such as when the gNMI target is behind a NAT gateway.

A gNMIReverse client can be run alongside the gNMI target and then "dial-out" to a gNMIReverse server to send streaming data.

An example gNMIReverse client and server program are provided in the client and server directories.

Documentation

Index

Constants

View Source
const (
	GNMIReverse_Publish_FullMethodName    = "/gnmireverse.gNMIReverse/Publish"
	GNMIReverse_PublishGet_FullMethodName = "/gnmireverse.gNMIReverse/PublishGet"
)

Variables

View Source
var File_gnmireverse_proto protoreflect.FileDescriptor
View Source
var GNMIReverse_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gnmireverse.gNMIReverse",
	HandlerType: (*GNMIReverseServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Publish",
			Handler:       _GNMIReverse_Publish_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "PublishGet",
			Handler:       _GNMIReverse_PublishGet_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "gnmireverse.proto",
}

GNMIReverse_ServiceDesc is the grpc.ServiceDesc for GNMIReverse service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterGNMIReverseServer

func RegisterGNMIReverseServer(s grpc.ServiceRegistrar, srv GNMIReverseServer)

Types

type GNMIReverseClient

type GNMIReverseClient interface {
	// Publish allows the client to publish gNMI SubscribeResponses to the
	// collector server. The client is typically run alongside the gNMI target
	// and forwards SubscribeResponses from the target to the collector server.
	// The request is specified by the client.
	Publish(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[gnmi.SubscribeResponse, emptypb.Empty], error)
	// PublishGet allows the client to publish gNMI GetResponses to the
	// collector server. The client is typically run alongside the gNMI target
	// and forwards GetResponses from the target to the collector server.
	// The request and sample interval are specified by the client.
	PublishGet(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[gnmi.GetResponse, emptypb.Empty], error)
}

GNMIReverseClient is the client API for GNMIReverse 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 GNMIReverseServer

type GNMIReverseServer interface {
	// Publish allows the client to publish gNMI SubscribeResponses to the
	// collector server. The client is typically run alongside the gNMI target
	// and forwards SubscribeResponses from the target to the collector server.
	// The request is specified by the client.
	Publish(grpc.ClientStreamingServer[gnmi.SubscribeResponse, emptypb.Empty]) error
	// PublishGet allows the client to publish gNMI GetResponses to the
	// collector server. The client is typically run alongside the gNMI target
	// and forwards GetResponses from the target to the collector server.
	// The request and sample interval are specified by the client.
	PublishGet(grpc.ClientStreamingServer[gnmi.GetResponse, emptypb.Empty]) error
	// contains filtered or unexported methods
}

GNMIReverseServer is the server API for GNMIReverse service. All implementations must embed UnimplementedGNMIReverseServer for forward compatibility.

type GNMIReverse_PublishClient

type GNMIReverse_PublishClient = grpc.ClientStreamingClient[gnmi.SubscribeResponse, emptypb.Empty]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type GNMIReverse_PublishGetClient

type GNMIReverse_PublishGetClient = grpc.ClientStreamingClient[gnmi.GetResponse, emptypb.Empty]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type GNMIReverse_PublishGetServer

type GNMIReverse_PublishGetServer = grpc.ClientStreamingServer[gnmi.GetResponse, emptypb.Empty]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type GNMIReverse_PublishServer

type GNMIReverse_PublishServer = grpc.ClientStreamingServer[gnmi.SubscribeResponse, emptypb.Empty]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type UnimplementedGNMIReverseServer

type UnimplementedGNMIReverseServer struct{}

UnimplementedGNMIReverseServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedGNMIReverseServer) PublishGet

type UnsafeGNMIReverseServer

type UnsafeGNMIReverseServer interface {
	// contains filtered or unexported methods
}

UnsafeGNMIReverseServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GNMIReverseServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL