clientapi

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

SPDX-FileCopyrightText: (C) 2025 Intel Corporation SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	MetricHost    int = 0
	MetricCluster int = 1
	LogHost       int = 2
	LogCluster    int = 3
)

Define enum constants with specific values

View Source
const CONN_TIMEOUT = 5 * time.Second
View Source
const NUM_RETRIES = 3

Variables

View Source
var LastProfile []ProfileGroup

Functions

func CheckIfChanged

func CheckIfChanged(latestCfg *pb.GetTelemetryConfigResponse) ([4]bool, [4]bool)

func GetConfig

func GetConfig(ctx context.Context, cli pb.TelemetryMgrClient, nodeId string, jwtTokenPath string) (*pb.GetTelemetryConfigResponse, error)

func WithNetworkDialer

func WithNetworkDialer(serverAddr string) func(*Client)

Types

type Client

type Client struct {
	ServerAddr       string
	Dialer           grpc.DialOption
	Transport        grpc.DialOption
	GrpcConn         *grpc.ClientConn
	SouthboundClient pb.TelemetryMgrClient
}

func ConnectToTelemetryManager

func ConnectToTelemetryManager(ctx context.Context, serverAddr string, devMode bool) (*Client, error)

ConnectToTelemetryManager function uses comms API's and the Telemetry Manager address to connect with GRPC the Telemetry Manager server. The function will return the Client struct In case of error the function will print the error message, will sleep for some period time and will try again.

func NewClient

func NewClient(serverAddr string, tlsConfig *tls.Config, devMode bool, options ...func(*Client)) *Client

NewClient creates grpc client to server southbound API by default it uses tcp network dialer

func (*Client) Connect

func (cli *Client) Connect() (err error)

Connect client method establishes GRPC connection with server. In case of an error the function will return the error.

type ProfileGroup

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

Jump to

Keyboard shortcuts

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