cli

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Overview

Package cli provides the query capabilities for streaming telemetry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseSubscribeProto

func ParseSubscribeProto(p string) (client.Query, error)

ParseSubscribeProto parses given gNMI SubscribeRequest text proto into client.Query.

func QueryDisplay

func QueryDisplay(ctx context.Context, query client.Query, cfg *Config) error

QueryDisplay constructs a query from the supplied arguments (target, queries, queryType), sends as an RPC to the specified destination address and displays results with the supplied display function.

func QueryType

func QueryType(t string) client.Type

QueryType returns a client query type for t after trying aliases for the type.

Types

type Config

type Config struct {
	PollingInterval   time.Duration // Duration between polling events.
	StreamingDuration time.Duration // Duration to collect updates, 0 is forever.
	Count             uint          // Number of polling/streaming events, 0 is infinite.

	Delimiter     string       // Delimiter between path elements when converted to string.
	Display       func([]byte) // Function called to display each result.
	DisplayPrefix string       // Prefix for each line of result output.
	DisplayIndent string       // Indent per nesting level of result output.
	DisplayType   string       // Display results in selected format, grouped, single, proto.
	DisplayPeer   bool         // Display the immediate connected peer.
	// <empty string> - disable timestamp
	// on - human readable timestamp according to layout
	// raw - int64 nanos since epoch
	// <FORMAT> - human readable timestamp according to <FORMAT>
	Timestamp        string // Formatting of timestamp in result output.
	DisplaySize      bool
	Latency          bool           // Show latency to client. For single DisplayType only.
	ClientTypes      []string       // List of client types to try.
	Location         *time.Location // Location that time formatting uses in lieu of the local time zone.
	FilterDeletes    bool           // Filter out delete results. For single DisplayType only.
	FilterUpdates    bool           // Filter out update results. For single DisplayType only.
	FilterMinLatency time.Duration  // Filter out results not meeting minimum latency. For single DisplayType only.
	// contains filtered or unexported fields
}

Config is a type to hold parameters that affect how the cli sends and displays results.

Jump to

Keyboard shortcuts

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