protocol

package
v0.0.0-...-8171c4f Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxRecvMsgSize    = 100 * 1024 * 1024
	DefaultMaxSendMsgSize    = 100 * 1024 * 1024
	DefaultConnTimeout       = 5 * time.Second
	DefaultKeepaliveInterval = 1 * time.Minute
	DefaultKeepaliveTimeout  = 20 * time.Second
)

Defaults for GRPCClient configurations.

Variables

This section is empty.

Functions

func NewTLSConfig

func NewTLSConfig(c cfg.TLSConfig) (*tls.Config, error)

NewTLSConfig creates a new tls.Config for a given server's TLSConfig options.

Types

type GRPCClient

type GRPCClient struct {
	// contains filtered or unexported fields
}

GRPCClient is a lightweight wrapper around a gRPC client connection, providing an easy means by which to configure the connection.

func NewGRPCClient

func NewGRPCClient(cfg *config.ServerConfig) (*GRPCClient, error)

NewGRPCClient creates a new instance of a GRPCClient for the given target address.

func (*GRPCClient) Connect

func (client *GRPCClient) Connect(ctx context.Context, address string) (*grpc.ClientConn, error)

Connect to the gRPC server and return the new connection.

type OpenConfigTelemetryListener

type OpenConfigTelemetryListener struct {
	// contains filtered or unexported fields
}

OpenConfigTelemetryListener creates a gRPC connection to all configured servers and collects the telemetry data streamed from the servers.

func NewOpenConfigTelemetryListener

func NewOpenConfigTelemetryListener(c []*cfg.ServerConfig, deviceManager manager.DeviceManager) *OpenConfigTelemetryListener

NewOpenConfigTelemetryListener creates a new instance of an OpenConfigTelemetryListener.

func (*OpenConfigTelemetryListener) Run

func (listener *OpenConfigTelemetryListener) Run() error

Run the listener.

This will establish a connection with the gRPC server, subscribe to the configured resources, and collect and convert the streamed data into Synse readings.

func (*OpenConfigTelemetryListener) Stop

func (listener *OpenConfigTelemetryListener) Stop()

Stop the listener. This terminates all active gRPC client connections.

Directories

Path Synopsis
oc

Jump to

Keyboard shortcuts

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