cli

package
Version: v0.0.0-...-aed1ee4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

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
	ClientTypes []string // List of client types to try.
	// contains filtered or unexported fields
}

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

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL