Documentation ¶
Index ¶
Constants ¶
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 ¶
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.